解决冲突

This commit is contained in:
”chenxuelian“
2023-04-18 21:44:35 +08:00
33 changed files with 915 additions and 493 deletions

View File

@@ -27,13 +27,16 @@
} }
}, },
created() { created() {
this.getCertifiedCj()
this.imgUrl = uni.getStorageSync('img_url') this.imgUrl = uni.getStorageSync('img_url')
this.getCertifiedCj()
}, },
methods: { methods: {
// 获取认证厂家列表 // 获取认证厂家列表
getCertifiedCj() { getCertifiedCj() {
this.$apiServe.getCertifiedCj().then(res => { this.$apiServe.getCertifiedCj({
pageSize: 2,
pageNum: 1
}).then(res => {
// console.log('认证厂家', res.data.data) // console.log('认证厂家', res.data.data)
this.cjsList = res.data.data this.cjsList = res.data.data
}).finally(_ => {}) }).finally(_ => {})

View File

@@ -4,20 +4,20 @@
<u-avatar :src="avatar" size="100rpx" shape="circle" @click="changeAvatar()"></u-avatar> <u-avatar :src="avatar" size="100rpx" shape="circle" @click="changeAvatar()"></u-avatar>
</view> </view>
<view style="margin-top: 10rpx;margin-bottom: 4rpx;"> <view style="margin-top: 10rpx;margin-bottom: 4rpx;">
<u--image v-if="member=='2'" :src="normal" width="84rpx" height="30rpx"> <u--image v-if="member=='2'||member=='3'" :src="normal" width="84rpx" height="30rpx">
</u--image> </u--image>
<u--image v-if="member=='3'" :src="VIP" width="84rpx" height="30rpx"> <u--image v-if="member=='4'" :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 @click="changeAvatar()">{{nickname}}</text> <text @click="changeAvatar()" style="color: #fff;font-size: 26rpx;">{{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 style="margin:0 20rpx;"> <view style="margin:0 20rpx;">
<u-overlay :show="!isLoad"> <u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login> <login :timoutText="timoutText" @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay> </u-overlay>
</view> </view>
</view> </view>
@@ -38,13 +38,14 @@
}, },
data() { data() {
return { return {
member: false, member: '',
showEdit: true, showEdit: true,
avatar: '', avatar: '',
nickname: '用户', 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',
isLoad: true, isLoad: true,
timoutText: 1
}; };
}, },
created() { created() {
@@ -66,40 +67,39 @@
//获取头像昵称和普通会员和VIP会员 //获取头像昵称和普通会员和VIP会员
getUser() { getUser() {
this.$apiServe.getUser().then(res => { this.$apiServe.getUser().then(res => {
console.log('个人信息==', res.data); // if (res.data.msg === "登录超时,请重新登录") {
if (res.data.msg == "登录超时,请重新登录") { // this.isLoad = false
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { // }
this.$toast.warn('登录失败请重试') if (res.data.code === -1) {
this.isLoad = false this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
} }
var data = res.data.data var data = res.data.data
this.avatar = data.avatar console.log('data个人信息', data);
this.nickname = data.nickname if (data) {
this.member = data.member this.avatar = uni.getStorageSync('img_url') + data.avatar
this.nickname = data.nickname
this.member = data.member
uni.setStorageSync('user_id', data.user_id)
uni.setStorageSync('member', data.member)
uni.setStorageSync('agreement', data.agreement)
uni.setStorageSync('com_name', data.com_name)
uni.setStorageSync('com_mobile', data.com_mobile)
}
}).finally(_ => {}) }).finally(_ => {})
}, },
reOnLoad() { reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试') this.$toast.warn('登录失败请重试')
this.isLoad = false this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return return
} }
this.isLoad = true this.isLoad = true
this.$refs.myavatar.getUser() this.getUser()
}, },
failToLoad() { failToLoad() {
// uni.navigateBack({ uni.navigateBack({
// url: '/pages/my/my' url: '/pages/index/index'
// }) })
this.$toast.warn('登录失败请重试')
} }
} }
} }

View File

@@ -3,11 +3,11 @@
<u--form labelPosition="left" :model="model"> <u--form labelPosition="left" :model="model">
<u-form-item label="公司名称" prop="userInfo.name" borderBottom> <u-form-item label="公司名称" prop="userInfo.name" borderBottom>
<u--input v-model="model.userInfo.name" border="none" placeholder="请输入您的名称" <u--input v-model="model.userInfo.name" border="none" placeholder="请输入您的名称"
placeholderStyle="color: #CCCCCC;font-size: 24rpx;"></u--input> placeholderStyle="color: #CCCCCC;font-size: 24rpx;" :disabled="disabled"></u--input>
</u-form-item> </u-form-item>
<u-form-item label="公司电话" prop="userInfo.phone" borderBottom> <u-form-item label="公司电话" prop="userInfo.phone" borderBottom>
<u--input v-model="model.userInfo.phone" border="none" placeholder="请输入您的电话" <u--input v-model="model.userInfo.phone" border="none" placeholder="请输入您的电话"
placeholderStyle="color: #CCCCCC;font-size: 24rpx;"> placeholderStyle="color: #CCCCCC;font-size: 24rpx;" :disabled="disabled">
</u--input> </u--input>
</u-form-item> </u-form-item>
</u--form> </u--form>
@@ -19,6 +19,7 @@
name: "myForm", name: "myForm",
data() { data() {
return { return {
disabled: false,
model: { model: {
userInfo: { userInfo: {
name: '', name: '',
@@ -27,12 +28,20 @@
}, },
}; };
}, },
options: {
styleIsolation: 'shared', // 解除样式隔离
},
created() { created() {
// if (uni.getStorageSync('com_mobile') && uni.getStorageSync('com_name')) {
// this.model.userInfo.name = uni.getStorageSync('com_name')
// this.model.userInfo.phone = uni.getStorageSync('com_mobile')
// }
} }
} }
</script> </script>
<style> <style scoped>
/deep/.u-input__content__field-wrapper__field {
background-color: #fff !important;
}
</style> </style>

View File

@@ -32,19 +32,25 @@
} }
}, },
created() { created() {
this.getNews()
this.imgUrl = uni.getStorageSync('img_url') this.imgUrl = uni.getStorageSync('img_url')
this.getNews()
}, },
methods: { methods: {
getNews() { getNews() {
this.$apiServe.getNews().then(res => { this.$apiServe.getNews({
// console.log('行业新闻', res.data.data) pageSize: 3,
pageNum: 1
}).then(res => {
let newsData = res.data.data let newsData = res.data.data
for (const item of newsData) { console.log('新闻', newsData);
item.pub_time_str = dateFormat(item.pub_time_str) if (newsData) {
for (const item of newsData) {
item.pub_time_str = dateFormat(item.pub_time_str)
}
// newsData = newsData.slice(0, 3)
this.newsList = newsData
} }
newsData = newsData.slice(0, 3)
this.newsList = newsData
}).finally(_ => {}) }).finally(_ => {})
}, },
// 跳转到新闻详情页 // 跳转到新闻详情页

View File

@@ -2,23 +2,23 @@
<view> <view>
<view class="products_box"> <view class="products_box">
<u-grid :border="false" col="2"> <u-grid :border="false" col="2">
<u-grid-item v-for="(item,index) in productList" :key="index" @click="toDetailPage(item)"> <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 src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true">
</u-image> </u-image>
<view class="bgContent"> <view class="bgContent" @click="toDetailPage(item)">
<view> <view>
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true" <u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true"
@click="toDetailPage()"> @click="toDetailPage()">
</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 24rpx 14rpx 16rpx;">
<view class="title_box"> <view class="title_box">
<text class="title">{{item.name}}</text> <text class="title">{{item.name}}</text>
<u-tag :text="item.tags" 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.desc}} {{item.title}}
</view> </view>
<view class="releaseDate"> <view class="releaseDate">
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx" <u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"
@@ -41,7 +41,6 @@
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;" <view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-if="type==2&&productList.length==0"> v-if="type==2&&productList.length==0">
暂无更多浏览记录</view> 暂无更多浏览记录</view>
</view> </view>
</view> </view>
</template> </template>
@@ -57,9 +56,7 @@
imgUrl: '', imgUrl: '',
tagsArray: [], tagsArray: [],
productList: [], productList: [],
// showM: false, content: '您确定移除吗?'
content: '您确定移除吗?',
productList: []
} }
}, },
props: { props: {
@@ -69,22 +66,26 @@
styleIsolation: 'shared', // 解除样式隔离 styleIsolation: 'shared', // 解除样式隔离
}, },
created() { created() {
this.getHistoryOrCollection()
this.imgUrl = uni.getStorageSync('img_url') this.imgUrl = uni.getStorageSync('img_url')
this.getHistoryOrCollection()
}, },
methods: { methods: {
//获取历史记录 //获取历史记录
getHistoryOrCollection() { getHistoryOrCollection() {
this.$apiServe.getHistoryOrCollection(this.type).then(res => { this.$apiServe.getHistoryOrCollection(this.type).then(res => {
let data = res.data.data let data = res.data.data
for (const item of data) { console.log('浏览记录或收藏', res.data);
let tag = item.tags if (data) {
this.tagsArray = tag.split(',') for (const item of data) {
item.tags = this.tagsArray[0] let tag = item.tags
item.create_time = dateFormatHistory(item.create_time) if (tag) {
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
}
item.create_time = dateFormatHistory(item.create_time)
}
this.productList = data
} }
console.log('获取历史记录', data);
this.productList = data
}).finally(_ => { }).finally(_ => {
}) })
@@ -132,7 +133,7 @@
//点击图片跳转到详情页 //点击图片跳转到详情页
toDetailPage(item) { toDetailPage(item) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/detail/productsDetail/productsDetail?id=' + item.id url: '/pages/detail/productsDetail/productsDetail?id=' + item.product_id
}) })
} }
} }

View File

@@ -11,7 +11,7 @@
</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 24rpx 14rpx 16rpx;">
<view class="title_box"> <view class="title_box">
<text class="title">{{item.name}}</text> <text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag> <u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
@@ -53,8 +53,8 @@
// this.sortType = 2 // this.sortType = 2
// } // }
// }) // })
this.getProductsByThumb()
this.imgUrl = uni.getStorageSync('img_url') this.imgUrl = uni.getStorageSync('img_url')
this.getProductsByThumb()
}, },
methods: { methods: {
//获取按点赞量排列的产品列表 //获取按点赞量排列的产品列表
@@ -64,6 +64,7 @@
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum pageNum: this.pageNum
}).then(res => { }).then(res => {
console.log('产品列表2', res.data);
let tags = res.data.data let tags = res.data.data
for (const item of tags) { for (const item of tags) {
let tag = item.tags let tag = item.tags

View File

@@ -11,7 +11,7 @@
</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 24rpx 14rpx 16rpx;">
<view class="title_box"> <view class="title_box">
<text class="title">{{item.name}}</text> <text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag> <u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
@@ -38,7 +38,7 @@
export default { export default {
data() { data() {
return { return {
imgUrl: '', imgUrl: null,
tagsArray: [], tagsArray: [],
productList: [], productList: [],
pageNum: 1, // 当前页 pageNum: 1, // 当前页
@@ -47,15 +47,8 @@
} }
}, },
created() { created() {
// uni.$on("getCurrent", data => {
// if (data == 0) {
// this.sortType = 1
// } else if (data == 1) {
// this.sortType = 2
// }
// })
this.getProductsByTime()
this.imgUrl = uni.getStorageSync('img_url') this.imgUrl = uni.getStorageSync('img_url')
this.getProductsByTime()
}, },
methods: { methods: {
//获取按上架时间排列的产品列表 //获取按上架时间排列的产品列表
@@ -65,17 +58,21 @@
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum pageNum: this.pageNum
}).then(res => { }).then(res => {
console.log('产品列表1', res.data);
let tags = res.data.data let tags = res.data.data
for (const item of tags) { if (tags) {
let tag = item.tags for (const item of tags) {
this.tagsArray = tag.split(',') let tag = item.tags
item.tags = this.tagsArray[0] this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
}
this.$emit("getTimeLength", tags.length);
// 用于触底刷新 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
this.productList = [...this.productList, ...res.data.data]
//这用于上架时间和点赞量的数据切换
// this.productList = res.data.data
} }
this.$emit("getTimeLength", tags.length);
// 用于触底刷新 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
this.productList = [...this.productList, ...res.data.data]
//这用于上架时间和点赞量的数据切换
// this.productList = res.data.data
}).finally(_ => { }).finally(_ => {
}) })

View File

@@ -7,18 +7,14 @@
<u-icon name="arrow-left" color="#fff;" /> <u-icon name="arrow-left" color="#fff;" />
</view> </view>
<view class="search-input"> <view class="search-input">
<u-input v-if="!readOnly" <u-input v-if="!readOnly" v-model="queryParamF" :focus="true" placeholder="搜索优质产品"
v-model="queryParamF" prefixIcon="search" :border="false" style="background-color: #fff;border: none;"
:focus="true" confirm-type="go" @confirm="goSearch(queryParamF)" />
placeholder="搜索优质产品" <view v-else style="width: 360rpx;padding: 10rpx 20rpx;display: flex;align-items: center;"
prefixIcon="search" @click="goSearch">
:border="false"
style="background-color: #fff;border: none;"
confirm-type="go"
@confirm="goSearch(queryParamF)"/>
<view v-else style="width: 360rpx;padding: 10rpx 20rpx;display: flex;align-items: center;" @click="goSearch">
<u-icon name="search" color="#969696" size="22"></u-icon> <u-icon name="search" color="#969696" size="22"></u-icon>
<text style="margin-left:10rpx;font-size: 30rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #969696;line-height: 37rpx;">搜索优质商品</text> <text
style="margin-left:10rpx;font-size: 30rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #969696;line-height: 37rpx;">搜索优质商品</text>
</view> </view>
<view class="search-btn" @click="goSearch">搜索</view> <view class="search-btn" @click="goSearch">搜索</view>
</view> </view>
@@ -65,10 +61,10 @@
}, },
methods: { methods: {
goSearch(value) { goSearch(value) {
if(!this.queryParamF && value) { if (!this.queryParamF && value) {
this.queryParamF = value this.queryParamF = value
} }
if(this.readOnly) { if (this.readOnly) {
this.$emit('navigate') this.$emit('navigate')
return return
} }
@@ -94,12 +90,14 @@
margin: 10rpx 10rpx; margin: 10rpx 10rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.top-left { .top-left {
width: calc(100% - 200rpx); width: calc(100% - 200rpx);
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
height: 100%; height: 100%;
.search-input { .search-input {
display: flex; display: flex;
border: 2rpx solid #fff; border: 2rpx solid #fff;
@@ -107,6 +105,7 @@
border-radius: 50rpx; border-radius: 50rpx;
height: 100%; height: 100%;
margin-left: 10rpx; margin-left: 10rpx;
.search-btn { .search-btn {
font-size: 32rpx; font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;

View File

@@ -17,7 +17,9 @@
"delay": 0 "delay": 0
}, },
/* */ /* */
"modules": {}, "modules": {
"Share": {}
},
/* */ /* */
"distribute": { "distribute": {
/* android */ /* android */
@@ -43,7 +45,14 @@
/* ios */ /* ios */
"ios": {}, "ios": {},
/* SDK */ /* SDK */
"sdkConfigs": {} "sdkConfigs": {
"share": {
"weixin": {
"appid": "wx8da30ba464a770ba",
"UniversalLinks": ""
}
}
}
} }
}, },
/* */ /* */

18
package-lock.json generated
View File

@@ -2,25 +2,11 @@
"name": "pupil", "name": "pupil",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "lockfileVersion": 1,
"": {
"dependencies": {
"uview-ui": "^2.0.35"
}
},
"node_modules/uview-ui": {
"version": "2.0.36",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.36.tgz",
"integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==",
"engines": {
"HBuilderX": "^3.1.0"
}
}
},
"dependencies": { "dependencies": {
"uview-ui": { "uview-ui": {
"version": "2.0.36", "version": "2.0.36",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.36.tgz", "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz",
"integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==" "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA=="
} }
} }

View File

@@ -1,5 +1,5 @@
{ {
"dependencies": { "dependencies": {
"uview-ui": "^2.0.35" "uview-ui": "^2.0.36"
} }
} }

View File

@@ -21,29 +21,32 @@
} }
}, },
methods: { methods: {
handleSureClick() { // handleSureClick() {
let name = this.$refs.nameAndphone.model.userInfo.name // let name = this.$refs.nameAndphone.model.userInfo.name
let phone = this.$refs.nameAndphone.model.userInfo.phone // let phone = this.$refs.nameAndphone.model.userInfo.phone
this.$apiServe.bindComponyAndUpdate({ // if (!/^1[3456789]\d{9}$/.test(phone)) {
uid: 1, // this.$toast.warn('请输入正确的手机号')
type: 1, // return false
companyName: name, // }
companyPhone: phone // // this.$apiServe.bindComponyAndUpdate({
}).then(res => { // // uid: 1,
console.log('绑定公司', res.data); // // type: 1,
if (res.data.code == 20003) { // // companyName: name,
this.showM = true // // companyPhone: phone
} else if (res.data.code == 20005) { // // }).then(res => {
this.$toast.warn('请完善数据') // // console.log('绑定公司', res.data);
} // // if (res.data.code == 20003) {
}).finally(_ => {}) // // this.showM = true
}, // // } else if (res.data.code == 20005) {
confirm() { // // this.$toast.warn('请完善数据')
this.showM = false // // }
// uni.switchTab({ // // }).finally(_ => {})
// url: '/pages/my/my' // },
// }) // confirm() {
} // uni.reLaunch({
// url: '/pages/my/my'
// })
// }
} }
} }
</script> </script>

View File

@@ -3,7 +3,6 @@
<view class="change_avatar"> <view class="change_avatar">
<u-avatar :src="avatar" size="140rpx" shape="circle" @click="changeAvatar()"></u-avatar> <u-avatar :src="avatar" size="140rpx" shape="circle" @click="changeAvatar()"></u-avatar>
</view> </view>
<view> <view>
<u--form labelPosition="left" :model="model"> <u--form labelPosition="left" :model="model">
<u-form-item label="修改昵称" prop="userInfo.name" borderBottom> <u-form-item label="修改昵称" prop="userInfo.name" borderBottom>
@@ -40,17 +39,20 @@
//获取头像昵称 //获取头像昵称
getUser() { getUser() {
this.$apiServe.getUser().then(res => { this.$apiServe.getUser().then(res => {
console.log('头像昵称', res.data);
var data = res.data.data var data = res.data.data
this.avatar = data.avatar console.log('头像昵称', res);
this.model.userInfo.name = data.nickname if (data) {
this.avatar = uni.getStorageSync('img_url') + data.avatar
this.avatarUrl = '/' + data.avatar
this.model.userInfo.name = data.nickname
}
}).finally(_ => {}) }).finally(_ => {})
}, },
updatePromise(filePath) { updatePromise(filePath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const token = uni.getStorageSync('loginToken') const token = uni.getStorageSync('loginToken')
const a = uni.uploadFile({ const a = uni.uploadFile({
url: apiService.uploadImgUrl + '/upload/image/', url: apiService.uploadImgUrl,
filePath: filePath, filePath: filePath,
name: 'file', name: 'file',
header: { header: {
@@ -58,10 +60,7 @@
'Authorization': token 'Authorization': token
}, },
success: (res) => { success: (res) => {
console.log('上传头像', JSON.parse(res.data));
// setTimeout(() => {
resolve(JSON.parse(res.data).data.url) resolve(JSON.parse(res.data).data.url)
// }, 1000)
} }
}); });
}) })
@@ -78,7 +77,6 @@
const result = this.updatePromise(res.tempFilePaths[0]) //上传图片 const result = this.updatePromise(res.tempFilePaths[0]) //上传图片
result.then(value => { result.then(value => {
this.avatarUrl = '/' + value this.avatarUrl = '/' + value
console.log(this.avatarUrl);
}) })
} }
} }

View File

@@ -3,13 +3,14 @@
<u-navbar :autoBack="true" title="会员中心"></u-navbar> <u-navbar :autoBack="true" title="会员中心"></u-navbar>
<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 ref="myavatar" :center="show"></myAvatar>
<view style="height: 56rpx;"></view> <view style="height: 56rpx;"></view>
<myForm ref="nameAndphone"></myForm> <myForm ref="nameAndphone"></myForm>
<view class="commitment"> <view class="commitment">
{{commitment}} {{commitment}}
</view> </view>
<u-button type="success" text="升级VIP" color="#0EBB5B" @click="handleSureClick()"></u-button> <u-button type="success" :text="btnText" color="#0EBB5B" @click="handleSureClick()" :disabled="btnDisabled">
</u-button>
<u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm"> <u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="content"></rich-text> <rich-text :nodes="content"></rich-text>
</u-modal> </u-modal>
@@ -23,43 +24,79 @@
name: '', name: '',
phone: '', phone: '',
showM: false, showM: false,
btnText: '升级VIP',
btnDisabled: false,
//部分产品无权限访问需升级VIP //部分产品无权限访问需升级VIP
needAsk: '', needAsk: '',
//会员中心的用户名旁边不显示edit图标 //会员中心的用户名旁边不显示edit图标
show: false, show: false,
content: `请保持手机畅通<br> content: `请保持手机畅通<br>
客服会及时联系您`, 客服会及时联系您`,
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置' commitment: ''
} }
}, },
onLoad(option) { onLoad(option) {
console.log('ask', option.ask); if (uni.getStorageSync('member') == 2) {
this.btnText = '升级VIP'
} else if (uni.getStorageSync('member') == 3) {
this.btnText = '升级vip正在审核中'
this.btnDisabled = true
} else if (uni.getStorageSync('member') == 4) {
this.btnText = '升级VIP'
this.btnDisabled = true
}
this.commitment = uni.getStorageSync('agreement')
if (option.ask == 1) { if (option.ask == 1) {
this.needAsk = option.ask this.needAsk = option.ask
} }
if (uni.getStorageSync('com_name') && uni.getStorageSync('com_mobile')) {
if (uni.getStorageSync('member') == 3 || uni.getStorageSync('member') == 4) {
this.$refs.nameAndphone.model.userInfo.name = uni.getStorageSync('com_name')
this.$refs.nameAndphone.model.userInfo.phone = uni.getStorageSync('com_mobile')
this.$refs.nameAndphone.disabled = true
}
}
}, },
methods: { methods: {
handleSureClick() { handleSureClick() {
let name = this.$refs.nameAndphone.model.userInfo.name if (this.btnDisabled == false) {
let phone = this.$refs.nameAndphone.model.userInfo.phone let name = this.$refs.nameAndphone.model.userInfo.name
this.$apiServe.bindComponyAndUpdate({ let phone = this.$refs.nameAndphone.model.userInfo.phone
uid: 1, console.log('name', name);
type: 2, console.log('phone', phone);
companyName: name,
companyPhone: phone if (!/^1[3456789]\d{9}$/.test(phone)) {
}).then(res => { this.$toast.warn('请输入正确的手机号')
console.log('升级VIP', res.data); return false
if (res.data.code == 20003) {
this.showM = true
} else if (res.data.code == 20005) {
this.$toast.warn('请完善数据')
} }
}).finally(_ => {}) if (name == '') {
this.$toast.warn('请完善数据')
return false
}
if (name && phone) {
console.log('数据已完善');
this.$apiServe.bindComponyAndUpdate({
uid: uni.getStorageSync('user_id'),
type: 2,
companyName: name,
companyPhone: phone
}).then(res => {
console.log('升级VIP', res.data);
if (res.data.code == 20003) {
this.showM = true
} else if (res.data.code == 20005) {
this.$toast.warn('请完善数据')
}
}).finally(_ => {})
}
}
}, },
confirm() { confirm() {
this.showM = false uni.reLaunch({
url: '/pages/my/my'
})
if (this.needAsk == 1) { if (this.needAsk == 1) {
uni.switchTab({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
}) })
} }

View File

@@ -11,14 +11,19 @@
<view class="time_line"> <view class="time_line">
<view class="release_time"> <view class="release_time">
<text>{{item.pub_time}}</text> <text v-if="updateIndex==0||updateIndex==1">{{item.update_time}}</text>
<text v-else>{{item.update_time}}</text>
</view> </view>
<view style="display: flex;"> <view style="display: flex;">
<view class="btn" @click="editIdeasAndNeeds(item)"> <view class="btn" @click="viewIdeasOrNeeds(item)" v-if="item.status==1">
<u-icon name="eye" color="#15CA65" size="20"></u-icon>
<text class="btn_text">查看</text>
</view>
<view class="btn" @click="editIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="edit-pen" color="#15CA65" size="20"></u-icon> <u-icon name="edit-pen" color="#15CA65" size="20"></u-icon>
<text class="btn_text">修改</text> <text class="btn_text">修改</text>
</view> </view>
<view class="btn" @click="deleteIdeasAndNeeds(item)"> <view class="btn" @click="deleteIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="trash" color="#15CA65" size="20"></u-icon> <u-icon name="trash" color="#15CA65" size="20"></u-icon>
<text class="btn_text">删除</text> <text class="btn_text">删除</text>
</view> </view>
@@ -32,14 +37,20 @@
<text class="needs_text">{{item.pname}}</text> <text class="needs_text">{{item.pname}}</text>
<view class="time_line"> <view class="time_line">
<view class="release_time"> <view class="release_time">
<text>{{item.pub_time}}</text>
<text v-if="updateIndex==0||updateIndex==1">{{item.update_time}}</text>
<text v-else>{{item.update_time}}</text>
</view> </view>
<view style="display: flex;"> <view style="display: flex;">
<view class="btn" @click="editIdeasAndNeeds(item)"> <view class="btn" @click="viewIdeasOrNeeds(item)" v-if="item.status==1">
<u-icon name="eye" color="#15CA65" size="20"></u-icon>
<text class="btn_text">查看</text>
</view>
<view class="btn" @click="editIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="edit-pen" color="#15CA65" size="20"></u-icon> <u-icon name="edit-pen" color="#15CA65" size="20"></u-icon>
<text class="btn_text">修改</text> <text class="btn_text">修改</text>
</view> </view>
<view class="btn" @click="deleteIdeasAndNeeds(item)"> <view class="btn" @click="deleteIdeasAndNeeds(item)" v-if="item.status==0">
<u-icon name="trash" color="#15CA65" size="20"></u-icon> <u-icon name="trash" color="#15CA65" size="20"></u-icon>
<text class="btn_text">删除</text> <text class="btn_text">删除</text>
</view> </view>
@@ -74,27 +85,28 @@
name: '创意发布' name: '创意发布'
}], }],
needsList: [], needsList: [],
ideasList: [] ideasList: [],
updateIndex: ''
} }
}, },
onLoad(options) { onLoad(options) {
console.log(options) if (options && options.index) {
if(options && options.index) {
console.log(options)
options.index = options.index - 1 options.index = options.index - 1
this.updateIndex = options.index
this.tabChange(options) this.tabChange(options)
return return
} }
this.getIdeasAndNeeds() this.getIdeasAndNeeds()
}, },
methods: { methods: {
//获取创意发布 //获取创意发布或需求发布
getIdeasAndNeeds() { getIdeasAndNeeds() {
this.$apiServe.getIdeasAndNeeds(this.type).then(res => { this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
console.log('获取创意发布&需求发布', res.data.data);
let data = res.data.data let data = res.data.data
console.log('创意需求发布数据', res.data);
for (const item of data) { for (const item of data) {
item.pub_time = dateFormatXwDetail(item.pub_time) item.pub_time = dateFormatXwDetail(item.pub_time)
item.update_time = dateFormatXwDetail(item.update_time)
const imagesList = item.images && item.images.length > 0 ? item.images.split(';') : [] const imagesList = item.images && item.images.length > 0 ? item.images.split(';') : []
item.images = imagesList.map(item1 => { item.images = imagesList.map(item1 => {
item1 = uni.getStorageSync('img_url') + '/' + item1 item1 = uni.getStorageSync('img_url') + '/' + item1
@@ -113,7 +125,6 @@
//切换需求发布和创意发布 //切换需求发布和创意发布
tabChange(data) { tabChange(data) {
this.tabCurrent = data.index this.tabCurrent = data.index
// console.log('data.index', data.index);
if (data.index == 0) { if (data.index == 0) {
this.type = 1 this.type = 1
} else if (data.index == 1) { } else if (data.index == 1) {
@@ -121,17 +132,32 @@
} }
this.getIdeasAndNeeds() this.getIdeasAndNeeds()
}, },
//查看需求发布或创意发布
viewIdeasOrNeeds(item) {
const tabCurrent = this.tabCurrent
uni.removeStorage({ //删除Storage
key: 'update_item',
success: () => {
uni.setStorageSync('update_item', item);
uni.reLaunch({
url: '/pages/ideasAndNeeds/ideasAndNeeds?item=update_item' + '&index=' +
tabCurrent + '&view=' + 11
})
}
})
},
//修改我的需求 //修改我的需求
editIdeasAndNeeds(item) { editIdeasAndNeeds(item) {
const tabCurrent = this .tabCurrent const tabCurrent = this.tabCurrent
uni.removeStorage({ //删除Storage uni.removeStorage({ //删除Storage
key:'update_item', key: 'update_item',
success: () => { success: () => {
uni.setStorageSync('update_item', item); uni.setStorageSync('update_item', item);
uni.reLaunch({ uni.reLaunch({
url: '/pages/ideasAndNeeds/ideasAndNeeds?item=update_item' + '&index=' + tabCurrent url: '/pages/ideasAndNeeds/ideasAndNeeds?item=update_item' + '&index=' +
}) tabCurrent
} })
}
}) })
}, },
//二次确认删除我的需求或创意 //二次确认删除我的需求或创意
@@ -143,7 +169,6 @@
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.$apiServe.deleteIdeasAndNeeds(item.id).then(res => { that.$apiServe.deleteIdeasAndNeeds(item.id).then(res => {
// console.log('删除发布', res);
if (res.data.code == 1) { if (res.data.code == 1) {
that.$toast.warn('删除成功') that.$toast.warn('删除成功')
} }

View File

@@ -1,7 +1,21 @@
<template> <template>
<view> <view>
<certifiedCj></certifiedCj> <view class="xw_content" v-for="(item,index) in cjsList" :key="index" @click="clickCj(item)">
<view v-if="cjsShow" class="no-data">已经到底啦</view> <u--image :src="imgUrl+item.cover" width="112rpx" height="112rpx" :lazy-load="true">
</u--image>
<view class="xw_right">
<view class="xw_title">
{{item.name}}
</view>
<view style="display: flex;">
<!-- <text class="cj_tags" v-for="(tagsItem,tagsIndex) in item.tags" :key="tagsIndex">
{{tagsItem.tag}}
</text> -->
<text class="cj_tags">{{item.tag}}</text>
</view>
</view>
</view>
<view v-if="cjsShow==0" class="no-data">已经到底啦</view>
</view> </view>
</template> </template>
@@ -9,11 +23,46 @@
export default { export default {
data() { data() {
return { return {
cjsShow: true cjsShow: '',
cjsList: [],
imgUrl: '',
pageNum: 1, // 当前页
pageSize: 12, // 每页条数
}
},
onLoad() {
this.imgUrl = uni.getStorageSync('img_url')
this.getCertifiedCj()
},
onReachBottom() {
console.log('触底下拉');
if (this.cjsShow !== 0) {
this.pageNum++
this.getCertifiedCj()
} }
}, },
methods: { methods: {
// this.cjsShow = this.list.length === 0 ? true : false // 获取认证厂家列表
getCertifiedCj() {
this.$apiServe.getCertifiedCj({
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
console.log('认证厂家', res)
let cjsData = res.data.data
for (const item of cjsData) {
this.cjsShow = item.length
console.log('this.cjsShow', this.cjsShow);
}
this.cjsList = [...this.cjsList, ...res.data.data]
}).finally(_ => {})
},
// 跳转到认证厂家详情页
clickCj(item) {
uni.navigateTo({
url: '../certifiedCjDetail/certifiedCjDetail?id=' + item.id
})
}
} }
} }
</script> </script>

View File

@@ -21,10 +21,17 @@
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
</view> </view>
<view class="footer"> <view class="footer" @click="showModal()">
<u-icon name="kefu-ermai" color="#fff" size="30rpx"></u-icon> <u-icon name="kefu-ermai" color="#fff" size="30rpx"></u-icon>
<text>联系客服</text> <text>联系客服</text>
</view> </view>
<u-modal :show="showCall" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
@confirm="confirmCall" @cancel="cancelCall">
<view>
<view style="text-indent: 25rpx;">{{mobile}}</view>
<text>是否拨打客服电话</text>
</view>
</u-modal>
<view style="margin:0 20rpx;"> <view style="margin:0 20rpx;">
<u-overlay :show="!isLoad"> <u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login> <login @success="reOnLoad()" @fail="failToLoad()"></login>
@@ -44,30 +51,41 @@
id: '', id: '',
detailList: [], detailList: [],
imgUrl: '', imgUrl: '',
isLoad: true isLoad: true,
showCall: false,
mobile: '',
} }
}, },
onLoad(option) { onLoad(option) {
this.imgUrl = uni.getStorageSync('img_url')
this.id = option.id this.id = option.id
this.getCertifiedCjDetail() this.getCertifiedCjDetail()
this.imgUrl = uni.getStorageSync('img_url') this.getCsTel()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { // if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false // this.isLoad = false
// uni.navigateTo({ // return
// url: '../../pages/my/login/login' // }
// }) // this.isLoad = true
return
}
this.isLoad = true
}, },
methods: { methods: {
//获取客服电话
getCsTel() {
this.$apiServe.getCsTel().then(res => {
this.mobile = res.data.data.cs_tel
}).finally(_ => {})
},
//获取认证厂家详情 //获取认证厂家详情
getCertifiedCjDetail() { getCertifiedCjDetail() {
this.$apiServe.getCertifiedCjDetail(this.id).then(res => { this.$apiServe.getCertifiedCjDetail(this.id).then(res => {
// console.log('认证厂家详情页', res.data) if (res.data.code === -1) {
this.isLoad = false
}
console.log('认证厂家详情页', res.data)
if (res.data.data) { if (res.data.data) {
let data = res.data.data let data = res.data.data
data.images = data.images.split(';') if (data.images) {
data.images = data.images.split(';')
}
this.detailList = data this.detailList = data
} else { } else {
this.$toast.warn('没有更多详情了') this.$toast.warn('没有更多详情了')
@@ -78,22 +96,47 @@
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试') this.$toast.warn('登录失败请重试')
this.isLoad = false this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return return
} }
this.isLoad = true this.isLoad = true
this.getCertifiedCjDetail() this.getCertifiedCjDetail()
}, },
failToLoad() { failToLoad() {
this.$toast.warn('登录失败请重试') uni.reLaunch({
url: '/pages/index/index'
})
},
// 联系客服模态框
showModal() {
this.showCall = true
},
confirmCall() {
this.showCall = false
let phone = this.mobile
phone = phone.toString()
uni.makePhoneCall({
phoneNumber: phone,
success: function() {
console.log('拨打电话成功');
},
fail() {
console.log('打电话失败了');
}
})
},
cancelCall() {
this.showCall = false
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.u-modal__content {
padding: 43rpx 104rpx !important;
text-indent: 25rpx;
}
.feature { .feature {
padding: 20rpx 16rpx; padding: 20rpx 16rpx;
background-color: #fff; background-color: #fff;
@@ -160,6 +203,9 @@
} }
.footer { .footer {
position: absolute;
bottom: 0;
width: 100%;
height: 100rpx; height: 100rpx;
background: #0EBB5B; background: #0EBB5B;
display: flex; display: flex;

View File

@@ -1,6 +1,9 @@
<template> <template>
<view> <view>
<productsByTime></productsByTime> <productsByTime ref="productsByTime" @getTimeLength="getTimeLength"></productsByTime>
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-show="reachBottomLength===0">
没有更多数据了</view>
</view> </view>
</template> </template>
@@ -8,11 +11,22 @@
export default { export default {
data() { data() {
return { return {
reachBottomLength: ''
} }
}, },
onReachBottom() {
this.$refs.productsByTime.pageNum++
this.$refs.productsByTime.getProductsByTime()
},
onLoad() {
this.$refs.productsByTime.pageSize = 2
this.$refs.productsByTime.getProductsByTime()
},
methods: { methods: {
//获取按上架时间排列的产品列表length
getTimeLength(e) {
this.reachBottomLength = e
}
} }
} }
</script> </script>

View File

@@ -14,11 +14,9 @@
<view class="xwD_content"> <view class="xwD_content">
<u-parse :content="detailList.content" @preview="preview" @navigate="navigate"></u-parse> <u-parse :content="detailList.content" @preview="preview" @navigate="navigate"></u-parse>
</view> </view>
<view style="margin:0 20rpx;"> <!-- <u-modal :show="showM" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<u-overlay :show="!isLoad"> <rich-text :nodes="content"></rich-text>
<login @success="reOnLoad()" @fail="failToLoad()"></login> </u-modal> -->
</u-overlay>
</view>
</view> </view>
</template> </template>
@@ -26,59 +24,41 @@
import { import {
dateFormatXwDetail dateFormatXwDetail
} from '../../utills/date.js' } from '../../utills/date.js'
import login from 'pages/my/login/login'
export default { export default {
components: {
login
},
data() { data() {
return { return {
id: '', id: '',
detailList: [], detailList: [],
isLoad: true // showM: false,
// content: `该新闻已下架!`,
} }
}, },
onLoad(option) { onLoad(option) {
this.id = option.id this.id = option.id
this.getNewsDetail() this.getNewsDetail()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
}, },
methods: { methods: {
//获取行业新闻详情 //获取行业新闻详情
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);
if (res.data.code == 0 || res.data.msg == "该新闻已下架!") {
this.$toast.warn('该新闻已下架!')
// this.showM = true
}
if (res.data.data) { if (res.data.data) {
let detail = res.data.data let detail = res.data.data
detail.pub_time = dateFormatXwDetail(detail.pub_time) detail.pub_time = dateFormatXwDetail(detail.pub_time)
this.detailList = res.data.data this.detailList = res.data.data
} else {
this.$toast.warn('没有更多详情了')
} }
}).finally(_ => {}) }).finally(_ => {})
}, },
reOnLoad() { // confirm() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { // uni.reLaunch({
this.$toast.warn('登录失败请重试') // url: '/pages/index/index'
this.isLoad = false // })
// uni.navigateTo({ // }
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
this.getNewsDetail()
},
failToLoad() {
this.$toast.warn('登录失败请重试')
}
} }
} }
</script> </script>

View File

@@ -1,22 +1,73 @@
<template> <template>
<view> <view>
<news></news> <view class="xw_content" v-for="(item,index) in newsList" :key="index" @click="clickNews(item)">
<view v-if="newsShow" class="no-data">已经到底啦</view> <u--image :src="imgUrl+item.cover" width="192rpx" height="122rpx" :lazy-load="true">
</u--image>
<view class="xw_right">
<view class="xw_title">
{{item.title}}
</view>
<view style="display: flex;">
<text class="xw_time">
{{item.pub_time_str}}
</text>
<text class="xw_time xw_place">
{{item.pub_name}}
</text>
</view>
</view>
</view>
<view v-if="newsShow==0" class="no-data">已经到底啦</view>
</view> </view>
</template> </template>
<script> <script>
import {
dateFormat
} from '../../utills/date.js'
export default { export default {
data() { data() {
return { return {
newsShow: true, newsShow: '',
imgUrl: '',
newsList: [],
pageNum: 1, // 当前页
pageSize: 12, // 每页条数
} }
}, },
onLoad() { onLoad() {
this.imgUrl = uni.getStorageSync('img_url')
this.getNews()
},
onReachBottom() {
console.log('触底下拉');
if (this.newsShow !== 0) {
this.pageNum++
this.getNews()
}
}, },
methods: { methods: {
// this.newsShow = this.list.length === 0 ? true : false getNews() {
this.$apiServe.getNews({
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
console.log('行业新闻', res.data)
let newsData = res.data.data
for (const item of newsData) {
item.pub_time_str = dateFormat(item.pub_time_str)
this.newsShow = item.length
console.log('this.newsShow', this.newsShow);
}
this.newsList = [...this.newsList, ...newsData]
}).finally(_ => {})
},
// 跳转到新闻详情页
clickNews(item) {
uni.navigateTo({
url: '../newsDetail/newsDetail?id=' + item.id
})
},
} }
} }
</script> </script>

View File

@@ -16,7 +16,7 @@
<image :src="item.icon" mode="aspectFit" class="icon" <image :src="item.icon" mode="aspectFit" class="icon"
:style="{border: item.active?'2rpx #14CA65 solid':'0',}" /> :style="{border: item.active?'2rpx #14CA65 solid':'0',}" />
</view> </view>
<view class="name" :style="{width: item.active?'156rpx':'126rpx'}"> <view class="name" :style="{width: item.active?'74px':'126rpx'}">
<u-tag v-if="item.active" :text="item.name" bg-color="#14CA65" color="#fff" <u-tag v-if="item.active" :text="item.name" bg-color="#14CA65" color="#fff"
borderColor="#14CA65" shape="circle" /> borderColor="#14CA65" shape="circle" />
<text v-else class="no-active">{{item.name}}</text> <text v-else class="no-active">{{item.name}}</text>
@@ -87,7 +87,7 @@
<view class="publish-date-box"> <view class="publish-date-box">
<view <view
style="width: fit-content; display: inline-block;margin-right:6rpx;"> style="width: fit-content; display: inline-block;margin-right:6rpx;">
<u-icon size="16" name="clock" color="#A3A3A3" /> <u-icon size="14" name="clock" color="#A3A3A3" />
</view> </view>
<text style="margin-right: 6rpx;">发布日期</text> <text style="margin-right: 6rpx;">发布日期</text>
<text>{{item1.pub_time_str}}</text> <text>{{item1.pub_time_str}}</text>
@@ -444,11 +444,11 @@
} }
.name { .name {
width: 126px; // width: 126px;
text-align: center; text-align: center;
.no-active { .no-active {
font-size: 28rpx; font-size: 24rpx;
font-family: PingFang-SC-Medium, PingFang-SC; font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500; font-weight: 500;
color: #616161; color: #616161;
@@ -500,7 +500,7 @@
line-height: 1; line-height: 1;
.title { .title {
font-size: 32rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #343434; color: #343434;
@@ -518,7 +518,7 @@
border-radius: 25% 0 0 0; border-radius: 25% 0 0 0;
.title { .title {
font-size: 32rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #14CA65; color: #14CA65;
@@ -669,6 +669,7 @@
.publish-date-box { .publish-date-box {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 22rpx;
} }
} }

View File

@@ -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 24rpx 14rpx 16rpx;">
<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>
@@ -43,10 +43,13 @@
pageNum: 1 pageNum: 1
}, },
queryTitle: null, queryTitle: null,
productList: [] imgUrl: null,
productList: [],
tagsArray: [],
} }
}, },
onLoad(options) { onLoad(options) {
this.imgUrl = uni.getStorageSync('img_url')
this.queryTitle = options.title this.queryTitle = options.title
this.goSearch() this.goSearch()
}, },
@@ -56,8 +59,17 @@
...this.queryParam, ...this.queryParam,
title: this.queryTitle title: this.queryTitle
} }
this.$apiServe.getProductList(data).then(res => { this.$apiServe.getProductList(data).then(res => {
this.productList = res.data.data let tags = res.data.data
if (tags) {
for (const item of tags) {
let tag = item.tags
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
}
this.productList = tags
}
}).finally(_ => {}) }).finally(_ => {})
}, },
//点击图片跳转到详情页 //点击图片跳转到详情页

View File

@@ -58,7 +58,6 @@
this.getDiscover() this.getDiscover()
const tempList = uni.getStorageSync('storage_search_record') const tempList = uni.getStorageSync('storage_search_record')
this.recentRecordList = tempList ? tempList : []; this.recentRecordList = tempList ? tempList : [];
console.log(this.recentRecordList)
const menuButtonInfo = uni.getMenuButtonBoundingClientRect(); const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
this.searchBarTop = menuButtonInfo.top; this.searchBarTop = menuButtonInfo.top;
this.searchBarHeight = menuButtonInfo.height; this.searchBarHeight = menuButtonInfo.height;
@@ -104,7 +103,6 @@
getDiscover() { getDiscover() {
this.$apiServe.getDiscover().then(res => { this.$apiServe.getDiscover().then(res => {
this.foundList = res.data.data this.foundList = res.data.data
console.log(res.data.data)
}).finally(_ => {}) }).finally(_ => {})
} }
} }

View File

@@ -160,7 +160,7 @@
"navigationBarTitleText": "行内新闻", "navigationBarTitleText": "行内新闻",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64", "navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false "enablePullDownRefresh": true
} }
}, { }, {
"path": "certifiedCj/certifiedCj", "path": "certifiedCj/certifiedCj",
@@ -168,7 +168,7 @@
"navigationBarTitleText": "认证厂家", "navigationBarTitleText": "认证厂家",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64", "navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false "enablePullDownRefresh": true
} }
}, { }, {
"path": "newsDetail/newsDetail", "path": "newsDetail/newsDetail",
@@ -193,7 +193,7 @@
"navigationBarTitleText": "企业需求", "navigationBarTitleText": "企业需求",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#12CA64", "navigationBarBackgroundColor": "#12CA64",
"enablePullDownRefresh": false "enablePullDownRefresh": true
} }
} }

View File

@@ -1,21 +1,24 @@
<template> <template>
<view> <view>
<view :key="index"> <view style="position: relative;padding-bottom: 100rpx;">
<u-image :src="imgUrl+detailList.cover" width="750rpx" height="530rpx"> <u-image :src="imgUrl+detailList.cover" width="750rpx" height="530rpx">
</u-image> </u-image>
<view class="collect" @click="starTap"> <view class="collect" v-if="detailList.is_fav==0||!detailList.is_fav" @click="starTap">
<view class="star"> <view class="star">
<u-image v-if="detailList.is_fav==0||!detailList.is_fav" src="/static/detail/xp_icon_wstar.png" <u-image src="/static/detail/xp_icon_wstar.png" width="28rpx" height="28rpx">
width="28rpx" height="28rpx"> </u-image>
</u-image> </view>
<u-image v-if="detailList.is_fav==1" src="/static/detail/xp_icon_star.png" width="28rpx" <u-image src="/static/detail/xiangqing_icon_shoucang.png" width="119rpx" height="48rpx">
height="28rpx"> </u-image>
</view>
<view class="collect" v-if="detailList.is_fav==1" @click="cancelStarTap(detailList.fav_id)">
<view class="star">
<u-image src="/static/detail/xp_icon_star.png" width="28rpx" 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>
<view class="content"> <view class="content">
<view class="title_box"> <view class="title_box">
<text class="title">{{detailList.name}}</text> <text class="title">{{detailList.name}}</text>
@@ -31,19 +34,33 @@
<view> <view>
<text class="tagOne" v-for="item in detailList.tags" :key="item.id">{{item}}</text> <text class="tagOne" v-for="item in detailList.tags" :key="item.id">{{item}}</text>
</view> </view>
<!-- thumb有值显示数字+ -->
<view v-if="detailList.thumb" class="heart"> <view v-if="detailList.thumb" class="heart">
<u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx"> <!-- 如果用户对该商品没有点赞显示灰星 -->
<u-image v-if="detailList.is_thumb==0" src="/static/detail/xp_icon_heart.png" width="34rpx"
height="32rpx" @click="heartTap">
</u-image> </u-image>
<text class="thumb">{{detailList.thumb}}</text> <!-- 如果用户对该商品已经点赞显示黄星-->
<u-image v-if="detailList.is_thumb==1" src="/static/detail/xp_icon_ysc.png" width="34rpx"
height="32rpx" @click="cancelHeartTap(detailList.thumb_id)">
</u-image>
<text class="thumb">{{detailList.thumb}} </text>
</view> </view>
<view v-else class="heart" @click="heartTap"> <!-- thumb无值显示点赞二字 用户进行一次点赞之后显示1赞-->
<u-image v-if="showHeart==false" src="/static/detail/xp_icon_heart.png" width="34rpx" <view v-else class="heart">
height="32rpx"> <view v-if="detailList.is_thumb==0" style="display: flex;">
</u-image> <u-image src="/static/detail/xp_icon_heart.png" width="34rpx" height="32rpx"
<u-image v-if="showHeart==true" src="/static/detail/xp_icon_ysc.png" width="34rpx" @click="heartTap">
height="32rpx"> </u-image>
</u-image> <text class="thumb" @click="heartTap">点赞</text>
<text class="thumb">点赞</text> </view>
<view v-if="detailList.is_thumb==1" style="display: flex;">
<!-- 用户是否点赞字段 showHeart -->
<u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx"
@click="cancelHeartTap(detailList.thumb_id)">
</u-image>
<text class="thumb">{{detailList.thumb}} </text>
</view>
</view> </view>
</view> </view>
</view> </view>
@@ -54,16 +71,32 @@
<text class="release">发布日期</text> <text class="release">发布日期</text>
<text>{{detailList.pub_time}}</text> <text>{{detailList.pub_time}}</text>
</view> </view>
<u-parse :content="detailList.desc" @preview="preview" @navigate="navigate"></u-parse> <u-parse :content="detailList.desc" @preview="preview" @navigate="navigate"></u-parse>
<u-modal :show="showCall" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
@confirm="confirmCall" @cancel="cancelCall">
<view>
<view style="text-indent: 25rpx;">{{mobile}}</view>
<text>是否拨打客服电话</text>
</view>
</u-modal>
<view style="margin:0 20rpx;"> <view style="margin:0 20rpx;">
<u-overlay :show="!isLoad"> <u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login> <login :timoutText="timoutText" @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay> </u-overlay>
</view> </view>
<u-modal :show="showM" :content='content' closeOnClickOverlay="false" showCancelButton="true" <u-modal :show="showUpdate" :content='content' closeOnClickOverlay="false" showCancelButton="true"
confirmText="升级VIP" @confirm="confirm" confirmColor="#0EBB5B"> confirmText="升级VIP" @confirm="confirm" @cancel="cancel" confirmColor="#0EBB5B">
<rich-text :nodes="content"></rich-text> <rich-text :nodes="updateContent"></rich-text>
</u-modal> </u-modal>
<u-modal :show="showUpdating" closeOnClickOverlay="false" confirmText="确定" @confirm="confirm">
<rich-text :nodes="updatingContent"></rich-text>
</u-modal>
</view>
<view class="footer" @click="showContact()">
<u-icon name="kefu-ermai" color="#fff" size="30rpx"></u-icon>
<text>联系客服</text>
</view> </view>
</view> </view>
</template> </template>
@@ -81,76 +114,120 @@
return { return {
id: '', id: '',
imgUrl: '', imgUrl: '',
tagsArray: [],
showHeart: false, showHeart: false,
detailList: [], detailList: [],
isLoad: true, isLoad: true,
showM: false, showUpdate: false,
content: '您暂无权限访问请升级VIP访问' showUpdating: false,
showCall: false,
mobile: '',
updateContent: '您暂无权限访问请升级VIP访问',
updatingContent: '升级VIP正在审核中',
timoutText: 1
} }
}, },
onLoad(option) { onLoad(option) {
this.imgUrl = uni.getStorageSync('img_url')
this.id = option.id this.id = option.id
this.getProductDetail() this.getProductDetail()
this.imgUrl = uni.getStorageSync('img_url') this.getCsTel()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
}, },
methods: { methods: {
//获取客服电话
getCsTel() {
this.$apiServe.getCsTel().then(res => {
this.mobile = res.data.data.cs_tel
}).finally(_ => {})
},
//获取详情信息 //获取详情信息
getProductDetail() { getProductDetail() {
this.$apiServe.getProductDetail(this.id).then(res => { this.$apiServe.getProductDetail(this.id).then(res => {
console.log('产品详情', res.data) console.log('产品详情', res);
if (res.data.data.thumb) { let detail = res.data.data
this.isThumb = true let dataCode = res.data.code
if (dataCode === -1 || res.statusCode == 500) {
this.isLoad = false
} }
if (res.data.msg == "没有权限访问" && uni.getStorageSync('loginToken')) { //授权登录拦截
this.showM = true if (dataCode == 0 && detail.mytpe == 1) {
this.isLoad = false
} }
if (res.data.data) { //跳转到升级VIP页面
let detail = res.data.data if (dataCode == 0 && detail.mytpe == 2) {
this.showUpdate = true
}
//升级VIP正在审核中
if (dataCode == 0 && detail.mytpe == 3) {
this.showUpdating = true
}
if (detail) {
detail.pub_time = dateFormatDetail(detail.pub_time) detail.pub_time = dateFormatDetail(detail.pub_time)
let tag = detail.tags if (detail.tags) {
this.tagsArray = tag.split(',') detail.tags = detail.tags.split(',')
detail.tags = this.tagsArray }
this.detailList = res.data.data
} else { // if (detail.is_thumb == 1 && parseInt(detail.thumb) == 1 && parseInt(detail
this.$toast.warn('没有更多详情了') // .thumbcount) == 1) {
// console.log('222');
// detail.thumb = parseInt(detail.thumbcount)
// } else {
detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount)
// }
this.detailList = detail
} }
}).finally(_ => {}) }).finally(_ => {})
}, },
//收藏按钮 //点击star收藏
starTap() { starTap() {
if (this.detailList.is_fav === 1) { if (!uni.getStorageSync('loginToken')) {
this.$toast.warn('已收藏') this.$toast.warn('请登录后操作')
} else if (this.detailList.is_fav === 0) { } else {
this.$apiServe.collect(this.id).then(res => { this.$apiServe.collect(this.id).then(res => {
// console.log('收藏成功', res.data)
if (res.data.code == 1) { if (res.data.code == 1) {
this.detailList.is_fav = 1
this.$toast.warn('收藏成功') this.$toast.warn('收藏成功')
this.getProductDetail()
} else { } else {
this.$toast.warn('收藏失败') this.$toast.warn('收藏失败')
} }
}).finally(_ => {}) }).finally(_ => {})
} }
}, },
//点击star取消收藏
cancelStarTap(fav_id) {
this.$apiServe.deleteHistoryOrCollection(fav_id).then(res => {
if (res.data.code == 1) {
this.$toast.warn('取消收藏')
this.getProductDetail()
} else {
this.$toast.warn('取消收藏失败')
}
}).finally(_ => {})
},
//点赞按钮 //点赞按钮
heartTap() { heartTap() {
// this.showHeart = !this.showHeart if (!uni.getStorageSync('loginToken')) {
this.$apiServe.thumb(this.id).then(res => { this.$toast.warn('请登录后操作')
console.log('点赞成功', res.data) } else {
this.$apiServe.thumb(this.id).then(res => {
if (res.data.code == 1) {
this.getProductDetail()
this.$toast.warn('点赞成功')
} else {
this.$toast.warn('点赞失败')
}
}).finally(_ => {})
}
},
//取消点赞
cancelHeartTap(thumb_id) {
this.$apiServe.cancelThumb(thumb_id).then(res => {
if (res.data.code == 1) { if (res.data.code == 1) {
this.showHeart = 1 this.getProductDetail()
this.$toast.warn('点赞成功') this.$toast.warn('取消点赞')
} else { } else {
this.$toast.warn('点赞失败') this.$toast.warn('取消点赞失败')
} }
}).finally(_ => {}) }).finally(_ => {})
}, },
@@ -167,12 +244,40 @@
this.getProductDetail() this.getProductDetail()
}, },
failToLoad() { failToLoad() {
this.$toast.warn('登录失败请重试') uni.reLaunch({
url: '/pages/index/index'
})
}, },
confirm() { confirm() {
uni.navigateTo({ uni.navigateTo({
url: '../../../packageMy/memberCenter/memberCenter?ask=' + 1 url: '../../../packageMy/memberCenter/memberCenter?ask=' + 1
}) })
},
cancel() {
uni.reLaunch({
url: '/pages/index/index'
})
},
// 联系客服模态框
showContact() {
this.showCall = true
},
confirmCall() {
this.showCall = false
let phone = this.mobile
phone = phone.toString()
uni.makePhoneCall({
phoneNumber: phone,
success: function() {
console.log('拨打电话成功');
},
fail() {
console.log('打电话失败了');
}
})
},
cancelCall() {
this.showCall = false
} }
} }
} }
@@ -292,12 +397,38 @@
display: flex; display: flex;
align-items: center; align-items: center;
padding: 24rpx 20rpx; padding: 24rpx 20rpx;
margin-top: 20rpx; margin: 20rpx 0;
background-color: #fff; background-color: #fff;
.release { .release {
padding: 0 10rpx 0 6rpx; padding: 0 10rpx 0 6rpx;
} }
} }
.footer {
position: fixed;
bottom: 0;
width: 100%;
height: 100rpx;
background: #0EBB5B;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
text-align: center;
.u-icon {
justify-content: center;
}
text {
font-size: 20rpx;
font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
font-weight: bold;
color: #FFFFFF;
line-height: 26rpx;
}
}
</style> </style>

View File

@@ -9,10 +9,10 @@
<view style="margin-bottom: 20rpx;"> <view style="margin-bottom: 20rpx;">
<u-form-item label="姓名" borderBottom> <u-form-item label="姓名" borderBottom>
<u-input v-model="needsPublishForm.name" :border="false" placeholder="请输入您的名称" <u-input v-model="needsPublishForm.name" :border="false" placeholder="请输入您的名称"
placeholder-style="color:#CCCCCC" /> placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff" />
</u-form-item> </u-form-item>
<u-form-item label="城市"> <u-form-item label="城市">
<view class="select-view" @tap="showCityPicker = true"> <view class="select-view" @tap="btnDisabled==true?showCityPicker=false:showCityPicker = true">
<text v-if="needsPublishForm.area_name">{{needsPublishForm.area_name}}</text> <text v-if="needsPublishForm.area_name">{{needsPublishForm.area_name}}</text>
<text v-else style="color:#CCCCCC;">请选择所在城市</text> <text v-else style="color:#CCCCCC;">请选择所在城市</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon> <u-icon name="arrow-right" color="#969696" size="14"></u-icon>
@@ -26,39 +26,46 @@
<view v-if="tabCurrent === 1"> <view v-if="tabCurrent === 1">
<u-form-item label="品名" borderBottom> <u-form-item label="品名" borderBottom>
<u-input v-model="needsPublishForm.pname" :border="false" placeholder="请输入您的产品名称" <u-input v-model="needsPublishForm.pname" :border="false" placeholder="请输入您的产品名称"
placeholder-style="color:#CCCCCC" /> placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff" />
</u-form-item> </u-form-item>
<u-form-item label="分类" borderBottom> <u-form-item label="分类" borderBottom>
<view class="select-view" @tap="showCategoryPicker = true"> <view class="select-view"
@tap="btnDisabled==true?showCategoryPicker=false: showCategoryPicker=true">
<text v-if="needsPublishForm.class">{{needsPublishForm.class}}</text> <text v-if="needsPublishForm.class">{{needsPublishForm.class}}</text>
<text v-else style="color:#CCCCCC;">请选择分类</text> <text v-else style="color:#CCCCCC;">请选择分类</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon> <u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view> </view>
<u-picker :show="showCategoryPicker" :columns="categoryPickerList" <u-picker :show="showCategoryPicker" :columns="categoryPickerList"
@cancel="showCategoryPicker = false" @confirm="getCategoryValue"></u-picker> @cancel="showCategoryPicker = false" @confirm="getCategoryValue">
</u-picker>
</u-form-item> </u-form-item>
</view> </view>
<u-form-item label="产品" borderBottom> <u-form-item label="产品" borderBottom>
<view class="select-view" @tap="showProductPicker = true"> <view class="select-view"
@tap="btnDisabled==true?showProductPicker=false: showProductPicker = true">
<text v-if="needsPublishForm.product">{{needsPublishForm.product}}</text> <text v-if="needsPublishForm.product">{{needsPublishForm.product}}</text>
<text v-else style="color:#CCCCCC;">请选择产品类型</text> <text v-else style="color:#CCCCCC;">请选择产品类型</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon> <u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view> </view>
<u-picker :show="showProductPicker" :columns="productPickerColumn" <u-picker :show="showProductPicker" :columns="productPickerColumn"
@cancel="showProductPicker = false" @confirm="getProductValue"></u-picker> @cancel="showProductPicker = false" @confirm="getProductValue">
</u-picker>
</u-form-item> </u-form-item>
<u-form-item label="定位" borderBottom> <u-form-item label="定位" borderBottom>
<view class="select-view" @tap="showPositionPicker = true"> <view class="select-view"
@tap="btnDisabled==true?showPositionPicker=false:showPositionPicker = true">
<text v-if="needsPublishForm.loc">{{needsPublishForm.loc}}</text> <text v-if="needsPublishForm.loc">{{needsPublishForm.loc}}</text>
<text v-else style="color:#CCCCCC;">请选择产品定位</text> <text v-else style="color:#CCCCCC;">请选择产品定位</text>
<u-icon name="arrow-right" color="#969696" size="14"></u-icon> <u-icon name="arrow-right" color="#969696" size="14"></u-icon>
</view> </view>
<u-picker :show=showPositionPicker :columns="positionPickerColumn" <u-picker :show=showPositionPicker :columns="positionPickerColumn"
@cancel="showPositionPicker = false" @confirm="getPositionValue"></u-picker> @cancel="showPositionPicker = false" @confirm="getPositionValue">
</u-picker>
</u-form-item> </u-form-item>
<view style="padding: 20rpx 15rpx;background-color: #fff;"> <view style="padding: 20rpx 15rpx;background-color: #fff;">
<u-textarea v-model="needsPublishForm.desc" border="surround" placeholder="请输入具体描述(限120字)" <u-textarea v-model="needsPublishForm.desc" border="surround" placeholder="请输入具体描述(限120字)"
:maxlength="120" placeholder-style="color:#CCCCCC"></u-textarea> :maxlength="120" placeholder-style="color:#CCCCCC" :disabled="btnDisabled"
disabledColor="#ffffff"></u-textarea>
</view> </view>
</view> </view>
@@ -66,7 +73,7 @@
<u-form-item label="上传图片" labelPosition="top"> <u-form-item label="上传图片" labelPosition="top">
<view style="padding-left: 20rpx;margin-top: 20rpx;"> <view style="padding-left: 20rpx;margin-top: 20rpx;">
<u-upload :fileList="fileList1" :auto-upload="false" @afterRead="afterRead" @delete="deletePic" <u-upload :fileList="fileList1" :auto-upload="false" @afterRead="afterRead" @delete="deletePic"
name="1" multiple :maxCount="10"></u-upload> name="1" multiple :maxCount="10" :disabled="btnDisabled"></u-upload>
</view> </view>
</u-form-item> </u-form-item>
</view> </view>
@@ -81,21 +88,23 @@
:customStyle="{marginRight: '16px'}" :customStyle="{marginRight: '16px'}"
label="手机" label="手机"
name="mobile" name="mobile"
:disabled="btnDisabled"
> >
</u-radio> </u-radio>
<u-radio <u-radio
label="邮箱" label="邮箱"
name="email" name="email"
:disabled="btnDisabled"
> >
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item v-if="needsPublishForm.contactWay === 'mobile'" label="手机" borderBottom> <u-form-item v-if="needsPublishForm.contactWay === 'mobile'" label="手机" borderBottom>
<u--input placeholder="请输入手机号" :border="false" v-model="needsPublishForm.mobile" <u--input placeholder="请输入手机号" :border="false" v-model="needsPublishForm.mobile"
placeholder-style="color:#CCCCCC"></u--input> placeholder-style="color:#CCCCCC" :disabled="btnDisabled" disabledColor="#ffffff"></u--input>
</u-form-item> </u-form-item>
<u-form-item v-if="needsPublishForm.contactWay === 'email'" label="邮箱" borderBottom> <u-form-item v-if="needsPublishForm.contactWay === 'email'" label="邮箱" borderBottom>
<u--input placeholder="请输入邮箱地址" :border="false" v-model="needsPublishForm.email" <u--input placeholder="请输入邮箱地址" :border="false" v-model="needsPublishForm.email" :disabled="btnDisabled"
placeholder-style="color:#CCCCCC"></u--input> placeholder-style="color:#CCCCCC"></u--input>
</u-form-item> </u-form-item>
<view style="padding: 6rpx 20rpx 0;text-align: left;background-color: #fff;"> <view style="padding: 6rpx 20rpx 0;text-align: left;background-color: #fff;">
@@ -114,12 +123,15 @@
</view> </view>
</u-form-item> --> </u-form-item> -->
<view style="padding: 30rpx;background-color: #fff;"> <view style="padding: 30rpx;background-color: #fff;">
<u-button color="#0EBB5B" text="确定发布" @tap.stop="submitForm"></u-button> <u-button color="#0EBB5B" text="确定发布" @tap.stop="submitForm" :disabled="btnDisabled"></u-button>
</view> </view>
<view style="padding: 10rpx 20rpx;text-align: center;background-color: #fff;"> <view style="padding: 12rpx 30rpx 20rpx 30rpx;background-color: #fff;">
<text style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;"> <text
您在确认发布后会由平台管理方经行审核审核通过后予以发布对于用户在本站发表的信息由用户个人承担对应责任本平台不承担任何法律责任 style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;"
</text> v-if="tabCurrent === 0">{{claim_r}}</text>
<text
style="font-size: 24rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;color: #C8C8C8;line-height: 28rpx;"
v-if="tabCurrent === 1">{{claim_c}}</text>
</view> </view>
</view> </view>
</u--form> </u--form>
@@ -143,6 +155,9 @@
}, },
data() { data() {
return { return {
btnDisabled: false,
claim_r: '',
claim_c: '',
tabsList: [{ tabsList: [{
name: '需求发布' name: '需求发布'
}, { }, {
@@ -163,18 +178,13 @@
productPickerList: [], productPickerList: [],
productPickerColumn: [ productPickerColumn: [
[] []
// {name: '烘焙', val: 'hongbei'}
// {name: '零食', val: 'ls'}
// {name: '饮料', val: 'yl'}
], ],
positionPickerList: [], positionPickerList: [],
positionPickerColumn: [ positionPickerColumn: [
[] []
], ],
categoryPickerList: [], categoryPickerList: [],
fileList1: [ fileList1: [],
// uploads/images/20230117/202301172309397deda1543.jpg
],
isLoad: true, isLoad: true,
cateName: null, cateName: null,
tagName: null, tagName: null,
@@ -183,17 +193,11 @@
} }
}, },
onTabItemTap() { onTabItemTap() {
console.log('----onShow')
// if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
// console.log(uni.getStorageSync('loginToken'))
// this.isLoad = false
// // uni.navigateTo({
// // url: '../../pages/my/login/login'
// // })
// return
// }
this.imgUrl = uni.getStorageSync('img_url') this.imgUrl = uni.getStorageSync('img_url')
console.log(this.imgUrl) if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
return
}
this.isLoad = true this.isLoad = true
this.token = uni.getStorageSync('loginToken') this.token = uni.getStorageSync('loginToken')
this.tabCurrent = 0 this.tabCurrent = 0
@@ -201,23 +205,18 @@
this.needsPublishForm = {} this.needsPublishForm = {}
}, },
onLoad(options) { onLoad(options) {
console.log('---onLoad')
console.log(options.item)
this.imgUrl = uni.getStorageSync('img_url') this.imgUrl = uni.getStorageSync('img_url')
//我的发布点击修改回显数据 //我的发布点击修改回显数据
if(options && options.item && uni.getStorageSync(options.item)) { if (options && options.item && uni.getStorageSync(options.item)) {
try{ try {
let publishFormList = uni.getStorageSync(options.item) let publishFormList = uni.getStorageSync(options.item)
console.log(publishFormList.images)
this.fileList1 = publishFormList.images.map(item => { this.fileList1 = publishFormList.images.map(item => {
console.log(this.imgUrl)
return { return {
url: item url: item
} }
}) })
console.log(this.fileList1)
this.needsPublishForm = publishFormList this.needsPublishForm = publishFormList
} catch(error) { } catch (error) {
this.$toast.warn(error) this.$toast.warn(error)
} }
} }
@@ -226,6 +225,9 @@
} else if (options.index == 1) { } else if (options.index == 1) {
this.tabCurrent = 1 this.tabCurrent = 1
} }
if (options.view == 11) {
this.btnDisabled = true
}
// this.getProductPickerList() // this.getProductPickerList()
}, },
onShow() { onShow() {
@@ -235,20 +237,24 @@
tabChange(data) { tabChange(data) {
this.tabCurrent = data.index this.tabCurrent = data.index
this.needsPublishForm = {} this.needsPublishForm = {}
this.fileList1 = []
this.btnDisabled = this.btnDisabled == true ? false : false;
}, },
getFormData() { getFormData() {
this.$apiServe.getIdeasAndNeedsFormdata().then(res => { this.$apiServe.getIdeasAndNeedsFormdata().then(res => {
console.log(res.data.data)
const formData = res.data.data const formData = res.data.data
this.productPickerColumn[0] = formData.product this.productPickerColumn[0] = formData.product
this.positionPickerColumn[0] = formData.loc this.positionPickerColumn[0] = formData.loc
this.categoryPickerList[0] = formData.class this.categoryPickerList[0] = formData.class
this.claim_r = formData.claim_r
this.claim_c = formData.claim_c
// this.productPickerList = res.data.data.map((item, index) => { // this.productPickerList = res.data.data.map((item, index) => {
// temp.push(item.name) // temp.push(item.name)
// return item // return item
// }) // })
// this.productPickerColumn[0] = [...temp] // this.productPickerColumn[0] = [...temp]
}).finally(_ => {}) }).finally(_ => {
})
}, },
// getProductPickerList() { // getProductPickerList() {
// const data = {} // const data = {}
@@ -279,7 +285,6 @@
// } // }
// }, // },
getCityValue(data) { getCityValue(data) {
console.log(data)
this.showCityPicker = false this.showCityPicker = false
this.needsPublishForm.area_name = data[0].join('-') this.needsPublishForm.area_name = data[0].join('-')
this.needsPublishForm.area_code = data[1] this.needsPublishForm.area_code = data[1]
@@ -288,7 +293,6 @@
this.showProductPicker = false this.showProductPicker = false
this.showCategoryPicker = false this.showCategoryPicker = false
this.needsPublishForm.product = data.value[0] this.needsPublishForm.product = data.value[0]
// console.log(data)
// const obj = this.productPickerList.find(item => { // const obj = this.productPickerList.find(item => {
// return item.name === data.value[0] // return item.name === data.value[0]
// }) // })
@@ -342,9 +346,6 @@
async afterRead(event) { async afterRead(event) {
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file) let lists = [].concat(event.file)
console.log(this.fileList1)
console.log(lists)
console.log(this[`fileList${event.name}`])
let fileListLen = this[`fileList${event.name}`].length let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => { lists.map((item) => {
this[`fileList${event.name}`].push({ this[`fileList${event.name}`].push({
@@ -354,7 +355,6 @@
}) })
}) })
for (let i = 0; i < lists.length; i++) { for (let i = 0; i < lists.length; i++) {
console.log(lists[i])
const result = await this.uploadFilePromise(lists[i].url) const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen] let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
@@ -367,16 +367,6 @@
}, },
uploadFilePromise(url) { uploadFilePromise(url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// const data = {
// file: new File
// }
// let a = apiService.postImage(data).then(res => {
// console.log(res)
// })
console.log('--345')
console.log(url)
console.log(this.token)
console.log(apiService.uploadImgUrl)
let a = uni.uploadFile({ let a = uni.uploadFile({
url: apiService.uploadImgUrl, url: apiService.uploadImgUrl,
filePath: url, filePath: url,
@@ -387,8 +377,6 @@
}, },
success: (res) => { success: (res) => {
setTimeout(() => { setTimeout(() => {
console.log('---355')
console.log(JSON.parse(res.data).data.url)
resolve(JSON.parse(res.data).data.url) resolve(JSON.parse(res.data).data.url)
}, 1000) }, 1000)
} }
@@ -396,7 +384,6 @@
}) })
}, },
submitForm() { submitForm() {
console.log(this.fileList1)
if (this.needsPublishForm.contactWay === 'mobile' && !/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) { if (this.needsPublishForm.contactWay === 'mobile' && !/^1[3456789]\d{9}$/.test(this.needsPublishForm.mobile)) {
this.$toast.warn('请输入正确的手机号') this.$toast.warn('请输入正确的手机号')
return false return false
@@ -406,12 +393,12 @@
} }
this.needsPublishForm.type = Number(this.tabCurrent + 1) this.needsPublishForm.type = Number(this.tabCurrent + 1)
this.needsPublishForm.pub_time = this.needsPublishForm.pub_time ? this.needsPublishForm.pub_time : this.needsPublishForm.pub_time = this.needsPublishForm.pub_time ? this.needsPublishForm.pub_time :
Math.round(new Date().getTime() / 1000) Math.round(new Date().getTime() / 1000)
const temp = [] const temp = []
if (this.fileList1.length > 0) { if (this.fileList1.length > 0) {
this.fileList1.map(item => { this.fileList1.map(item => {
const url = item.url const url = item.url
temp.push(url.replace(this.imgUrl+'/', '')) temp.push(url.replace(this.imgUrl + '/', ''))
}) })
} }
this.needsPublishForm.images = temp.join(';') this.needsPublishForm.images = temp.join(';')
@@ -434,10 +421,10 @@
apiService.submitIdeasAndNeeds(data).then(res => { apiService.submitIdeasAndNeeds(data).then(res => {
this.$toast.success('提交成功') this.$toast.success('提交成功')
console.log('esf=', res); console.log('esf=', res);
if(this.needsPublishForm.id) { if (this.needsPublishForm.id) {
uni.navigateTo({ uni.navigateTo({
url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1) url: '../../packageMy/myRelease/myRelease?index=' + (this.tabCurrent + 1)
}) })
} }
this.tabCurrent = 0 this.tabCurrent = 0
this.fileList1 = [] this.fileList1 = []
@@ -447,41 +434,21 @@
this.$toast.warn(error) this.$toast.warn(error)
}) })
}, },
reOnLoad() {
console.log('----------------true')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.token = uni.getStorageSync('loginToken')
this.isLoad = true
this.getFormData()
},
failToLoad() { failToLoad() {
console.log('----------------false')
this.$toast.warn('登录失败请重试') this.$toast.warn('登录失败请重试')
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
}) })
// uni.navigateBack({
// success: () => {
// let page = getCurrentPages().pop();
// if (page) {
// page.onLoad(page.options);//执行上个页面的方法
// };
// }
// })
} }
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/.u-textarea--disabled {
background-color: #ffffff !important;
}
.content { .content {
background-color: #F8F8F8; background-color: #F8F8F8;

View File

@@ -24,7 +24,9 @@
</view> </view>
<!-- 分类模块下的轮播图 --> <!-- 分类模块下的轮播图 -->
<view> <view>
<u-swiper :list="swiperList" keyName="img" indicatorMode="line" radius="0" circular></u-swiper> <u-swiper :list="swiperList" keyName="img" indicatorMode="line" radius="0" circular
@change="e => currentNum = e.current"
@click="handleSwiperList(currentNum==''?0:currentNum,swiperList)"></u-swiper>
</view> </view>
<!-- 选项卡: 上架时间和点赞量 --> <!-- 选项卡: 上架时间和点赞量 -->
@@ -34,9 +36,9 @@
</u-tabs> </u-tabs>
</view> </view>
<!-- 产品 --> <!-- 产品 -->
<productsByTime v-if="tabCurrent==0" ref="productsByTime" @getTimeLength="getTimeLength"> <productsByTime v-if="tabCurrent==0 && initStart" ref="productsByTime" @getTimeLength="getTimeLength">
</productsByTime> </productsByTime>
<productsByThumb v-if="tabCurrent==1" ref="productsByThumb" @getThumbLength="getThumbLength"> <productsByThumb v-if="tabCurrent==1 && initStart" ref="productsByThumb" @getThumbLength="getThumbLength">
</productsByThumb> </productsByThumb>
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;" <view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
v-show="reachBottomLength===0"> v-show="reachBottomLength===0">
@@ -61,8 +63,10 @@
}, },
], ],
imgUrl: '', imgUrl: '',
initStart: false,
swiperList: [], swiperList: [],
reachBottomLength: '', reachBottomLength: '',
currentNum: ''
} }
}, },
onReachBottom() { onReachBottom() {
@@ -75,33 +79,41 @@
this.$refs.productsByThumb.getProductsByThumb() this.$refs.productsByThumb.getProductsByThumb()
} }
}, },
onLoad() { created() {
// this.login()
this.getCategories()
this.getBanner()
this.getImgUrl() this.getImgUrl()
this.imgUrl = uni.getStorageSync('img_url')
}, },
methods: { methods: {
// login() { init() {
// var that = this this.imgUrl = uni.getStorageSync('img_url')
// uni.login({ this.getCategories()
// "provider": "weixin", this.getBanner()
// "onlyAuthorize": true, // 微信登录仅请求授权认证 wx.showShareMenu({
// success: function(event) { withShareTicket: true,
// const { //设置下方的Menus菜单才能够让发送给朋友与分享到朋友圈两个按钮可以点击
// code menus: ["shareAppMessage", "shareTimeline"]
// } = event })
// that.$apiServe.login({ },
// code: code //分享到微信好友
// }).then(res => { onShareAppMessage(res) {
// var data = res.data.data return {
// // console.log('登录code换取的信息', data); title: '食瞳',
// uni.setStorageSync('token', data.token); type: 0,
// }) path: '/pages/index/index?id=' + distSource,
// }, summary: "",
// }) imageUrl: "https://pupil.hchyun.com/uploads/product/zhanwei02.png"
// }, }
},
//分享到朋友圈
onShareTimeline(res) {
return {
title: '食瞳',
type: 0,
query: 'id=' + distSource,
summary: "",
imageUrl: "https://pupil.hchyun.com/uploads/product/zhanwei02.png"
}
},
//获取按上架时间排列的产品列表length //获取按上架时间排列的产品列表length
getTimeLength(e) { getTimeLength(e) {
this.reachBottomLength = e this.reachBottomLength = e
@@ -129,12 +141,21 @@
getBanner() { getBanner() {
this.$apiServe.getBanner().then(res => { this.$apiServe.getBanner().then(res => {
let banner = res.data.data let banner = res.data.data
for (const item of banner) { if (banner) {
item.img = this.imgUrl + item.img for (const item of banner) {
item.img = this.imgUrl + item.img
}
this.swiperList = res.data.data
} }
this.swiperList = res.data.data
}).finally(_ => {}) }).finally(_ => {})
}, },
//点击轮播图
handleSwiperList(currentNum, swiperList) {
swiperList[currentNum].link = swiperList[currentNum].link.replace(/\s*/g, "")
uni.navigateTo({
url: '/' + swiperList[currentNum].link
})
},
//点击搜索框跳转到搜索页面 //点击搜索框跳转到搜索页面
toSearch() { toSearch() {
uni.navigateTo({ uni.navigateTo({
@@ -150,12 +171,17 @@
//获取图片url //获取图片url
getImgUrl() { getImgUrl() {
this.$apiServe.getImgUrl().then(res => { this.$apiServe.getImgUrl().then(res => {
res.data.data.img_url = res.data.data.img_url + '/'
try { try {
uni.setStorageSync('img_url', res.data.data.img_url); uni.setStorageSync('img_url', res.data.data.img_url);
this.initStart = true
this.init()
} catch (e) { } catch (e) {
// error // error
} }
}).finally(_ => {}) }).finally(_ => {
})
} }
} }
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="login-content"> <view class="login-content">
<view style="text-align: center;margin-bottom:30rpx;"> <view style="text-align: center;margin-bottom:30rpx;">
<text>请登录后查看</text> <text>{{loginText}}</text>
</view> </view>
<view style="padding-left: 30rpx;padding-right: 30rpx;display: flex;"> <view style="padding-left: 30rpx;padding-right: 30rpx;display: flex;">
<u-button type="info" :plain="true" size="nomal" @click="$emit('fail')">取消</u-button> <u-button type="info" :plain="true" size="nomal" @click="$emit('fail')">取消</u-button>
@@ -18,7 +18,20 @@
} from '@/service/request.js' } from '@/service/request.js'
export default { export default {
data() { data() {
return {} return {
loginText: '请登录后查看'
}
},
props: {
timoutText: {
type: String,
default: ''
}
},
created() {
if (this.timoutText == 1) {
this.loginText = "登录超时,请重新登录"
}
}, },
methods: { methods: {
getphonenumber(e) { getphonenumber(e) {

View File

@@ -7,9 +7,12 @@
<myAvatar ref="myavatar"></myAvatar> <myAvatar ref="myavatar"></myAvatar>
<view class="table"> <view class="table">
<u-cell-group> <u-cell-group>
<u-cell size="large" title="绑定公司" icon="/static/my/wo_icon_bd.png" :isLink="true" value="未绑定公司" <!-- <u-cell v-if="is_bind" size="large" title="绑定公司" icon="/static/my/wo_icon_bd.png" :isLink="true"
value="已绑定公司">
</u-cell> -->
<!-- <u-cell v-else size="large" title="绑定公司" icon="/static/my/wo_icon_bd.png" :isLink="true" value="未绑定公司"
@click="bindCompany()"> @click="bindCompany()">
</u-cell> </u-cell> -->
<u-cell size="large" title="会员中心" icon="/static/my/wo_icon_hyzx.png" :isLink="true" <u-cell size="large" title="会员中心" icon="/static/my/wo_icon_hyzx.png" :isLink="true"
@click="toMemberCenter()"></u-cell> @click="toMemberCenter()"></u-cell>
<u-cell size="large" title="浏览记录" icon="/static/my/wo_icon_lljl.png" :isLink="true" <u-cell size="large" title="浏览记录" icon="/static/my/wo_icon_lljl.png" :isLink="true"
@@ -23,9 +26,9 @@
</u-cell> </u-cell>
</u-cell-group> </u-cell-group>
<u-modal :show="showM" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否" <u-modal :show="showM" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
@confirm="confirm" @cancel="cancel" @close="close"> @confirm="confirm" @cancel="cancel">
<view> <view>
<view>{{phone}}</view> <view>{{mobile}}</view>
<text>是否拨打客服电话</text> <text>是否拨打客服电话</text>
</view> </view>
</u-modal> </u-modal>
@@ -46,22 +49,34 @@
data() { data() {
return { return {
showM: false, showM: false,
phone: '138 1222 222', mobile: '',
isLoad: true, isLoad: true,
is_bind: false
} }
}, },
onTabItemTap() { onTabItemTap() {
this.$refs.myavatar.getUser() this.$refs.myavatar.getUser()
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return return
} }
this.isLoad = true this.isLoad = true
}, },
onLoad() {
if (uni.getStorageSync('com_mobile')) {
this.is_bind = true
}
this.getCsTel()
},
methods: { methods: {
//获取客服电话
getCsTel() {
this.$apiServe.getCsTel().then(res => {
if (res.data.data) {
this.mobile = res.data.data.cs_tel
}
}).finally(_ => {})
},
//跳转到绑定公司页面 //跳转到绑定公司页面
bindCompany() { bindCompany() {
uni.navigateTo({ uni.navigateTo({
@@ -98,7 +113,8 @@
}, },
confirm() { confirm() {
this.showM = false this.showM = false
let phone = '1381222222' let phone = this.mobile
phone = phone.toString()
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone, phoneNumber: phone,
success: function() { success: function() {
@@ -112,16 +128,10 @@
cancel() { cancel() {
this.showM = false this.showM = false
}, },
close() {
this.showM = false
},
reOnLoad() { reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) { if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试') this.$toast.warn('登录失败请重试')
this.isLoad = false this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return return
} }
this.isLoad = true this.isLoad = true
@@ -130,10 +140,9 @@
} }
}, },
failToLoad() { failToLoad() {
// uni.navigateBack({ uni.reLaunch({
// url: '/pages/my/my' url: '/pages/index/index'
// }) })
this.$toast.warn('登录失败请重试')
} }
} }
} }

View File

@@ -21,7 +21,7 @@
<news></news> <news></news>
</view> </view>
<!-- 新品发布 --> <!-- 企业需求 -->
<view> <view>
<view class="subtitle"> <view class="subtitle">
<u--image src="/static/report/hy_icon_fux.png" width="24rpx" height="24rpx" :lazy-load="true"> <u--image src="/static/report/hy_icon_fux.png" width="24rpx" height="24rpx" :lazy-load="true">
@@ -32,7 +32,7 @@
</view> </view>
<!-- 认证厂家 --> <!-- 认证厂家 -->
<view> <view v-if="token==true">
<view class="subtitle"> <view class="subtitle">
<u--image src="/static/report/hy_icon_cjx.png" width="24rpx" height="24rpx" :lazy-load="true"> <u--image src="/static/report/hy_icon_cjx.png" width="24rpx" height="24rpx" :lazy-load="true">
</u--image> </u--image>
@@ -40,13 +40,24 @@
</view> </view>
<certifiedCj></certifiedCj> <certifiedCj></certifiedCj>
</view> </view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view> </view>
</template> </template>
<script> <script>
import login from 'pages/my/login/login'
export default { export default {
components: {
login
},
data() { data() {
return { return {
isLoad: true,
token: '',
classifyList: [{ classifyList: [{
src: '/static/report/hy_icon_xw.png', src: '/static/report/hy_icon_xw.png',
title: '行业新闻' title: '行业新闻'
@@ -60,7 +71,16 @@
title: '认证厂家' title: '认证厂家'
}, },
], ],
}
},
onLoad() {
if (uni.getStorageSync('loginToken')) {
this.token = true
}
},
onShow() {
if (uni.getStorageSync('loginToken')) {
this.token = true
} }
}, },
methods: { methods: {
@@ -76,12 +96,33 @@
url: '../../packageReport/newProductRelease/newProductRelease' url: '../../packageReport/newProductRelease/newProductRelease'
}) })
} else if (listIndex == 2) { } else if (listIndex == 2) {
if (uni.getStorageSync('loginToken')) {
uni.navigateTo({
url: '../../packageReport/certifiedCj/certifiedCj'
})
} else {
this.isLoad = false
}
}
},
reOnLoad() {
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.$toast.warn('登录失败请重试')
this.isLoad = false
return
}
this.isLoad = true
if (this.isLoad) {
uni.navigateTo({ uni.navigateTo({
url: '../../packageReport/certifiedCj/certifiedCj' url: '../../packageReport/certifiedCj/certifiedCj'
}) })
} }
}, },
failToLoad() {
uni.reLaunch({
url: '/pages/report/report'
})
}
} }
} }

View File

@@ -1,4 +1,4 @@
const serverHost = 'https://pupil.hchyun.com/api' // https://api-ugo-web.itheima.net' const serverHost = 'https://www.foodtops.cn/api' // https://api-ugo-web.itheima.net'
function isOutTime(res) { function isOutTime(res) {
if (res.data.message === '请先登录') { if (res.data.message === '请先登录') {
uni.showToast('登录信息已过期,请重新登录') uni.showToast('登录信息已过期,请重新登录')
@@ -205,7 +205,7 @@ const toast = {
} }
} }
const apiService = { const apiService = {
uploadImgUrl: serverHost + `/upload/image/`, uploadImgUrl: serverHost + `/upload/image/`,
imgUrl: serverHost, imgUrl: serverHost,
// login: data => { // login: data => {
// data = Object.assign(data || {}, {}) // data = Object.assign(data || {}, {})
@@ -243,10 +243,10 @@ const apiService = {
}) })
}, },
// 获取行业新闻 // 获取行业新闻
getNews() { getNews(data) {
const url = `/news/nlists/?pageSize=50&pageNum=1` const url = `/news/nlists`
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(service.get(url)) resolve(service.get(url, data))
}) })
}, },
// 获取行业新闻详情 // 获取行业新闻详情
@@ -257,10 +257,10 @@ const apiService = {
}) })
}, },
// 获取认证厂家列表 // 获取认证厂家列表
getCertifiedCj() { getCertifiedCj(data) {
const url = `/news/flists?pageSize=50&pageNum=1` const url = `/news/flists`
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(service.get(url)) resolve(service.get(url, data))
}) })
}, },
// 获取认证厂家详情 // 获取认证厂家详情
@@ -319,6 +319,13 @@ const apiService = {
resolve(service.post(url, pid)) resolve(service.post(url, pid))
}) })
}, },
//取消(清除)点赞
cancelThumb(id) {
const url = `/center/thumbcls/?id=${id}`
return new Promise((resolve, reject) => {
resolve(service.post(url, id))
})
},
//获取个人信息 //获取个人信息
getUser() { getUser() {
const url = `/center/userinfo` const url = `/center/userinfo`
@@ -333,6 +340,13 @@ const apiService = {
resolve(service.post(url, data)) resolve(service.post(url, data))
}) })
}, },
// 获取客服电话
getCsTel() {
const url = `/center/cfg?key=cs_tel`
return new Promise((resolve, reject) => {
resolve(service.get(url))
})
},
// 获取首页分类Tag // 获取首页分类Tag
getTags(data) { getTags(data) {
const url = `/home/tags` const url = `/home/tags`

View File

@@ -16,16 +16,15 @@
} }
.my_avatar { .my_avatar {
margin-top: -200rpx; margin-top: -186rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text { text {
font-size: 26rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #FFFFFF;
line-height: 37rpx; line-height: 37rpx;
} }
} }

View File

@@ -8,10 +8,7 @@
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
width:356rpx;
.u-image__image {
margin-left: 6px;
}
.img_tag { .img_tag {
position: absolute; position: absolute;