解决冲突

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() {
this.getCertifiedCj()
this.imgUrl = uni.getStorageSync('img_url')
this.getCertifiedCj()
},
methods: {
// 获取认证厂家列表
getCertifiedCj() {
this.$apiServe.getCertifiedCj().then(res => {
this.$apiServe.getCertifiedCj({
pageSize: 2,
pageNum: 1
}).then(res => {
// console.log('认证厂家', res.data.data)
this.cjsList = res.data.data
}).finally(_ => {})

View File

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

View File

@@ -3,11 +3,11 @@
<u--form labelPosition="left" :model="model">
<u-form-item label="公司名称" prop="userInfo.name" borderBottom>
<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 label="公司电话" prop="userInfo.phone" borderBottom>
<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-form-item>
</u--form>
@@ -19,6 +19,7 @@
name: "myForm",
data() {
return {
disabled: false,
model: {
userInfo: {
name: '',
@@ -27,12 +28,20 @@
},
};
},
options: {
styleIsolation: 'shared', // 解除样式隔离
},
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>
<style>
<style scoped>
/deep/.u-input__content__field-wrapper__field {
background-color: #fff !important;
}
</style>

View File

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

View File

@@ -2,23 +2,23 @@
<view>
<view class="products_box">
<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>
<view class="bgContent">
<view class="bgContent" @click="toDetailPage(item)">
<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 style="padding: 14rpx 24rpx 14rpx 16rpx;">
<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.desc}}
{{item.title}}
</view>
<view class="releaseDate">
<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;"
v-if="type==2&&productList.length==0">
暂无更多浏览记录</view>
</view>
</view>
</template>
@@ -57,9 +56,7 @@
imgUrl: '',
tagsArray: [],
productList: [],
// showM: false,
content: '您确定移除吗?',
productList: []
content: '您确定移除吗?'
}
},
props: {
@@ -69,22 +66,26 @@
styleIsolation: 'shared', // 解除样式隔离
},
created() {
this.getHistoryOrCollection()
this.imgUrl = uni.getStorageSync('img_url')
this.getHistoryOrCollection()
},
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);
if (data) {
for (const item of data) {
let tag = item.tags
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(_ => {
})
@@ -132,7 +133,7 @@
//点击图片跳转到详情页
toDetailPage(item) {
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>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 22rpx;">
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
@@ -53,8 +53,8 @@
// this.sortType = 2
// }
// })
this.getProductsByThumb()
this.imgUrl = uni.getStorageSync('img_url')
this.getProductsByThumb()
},
methods: {
//获取按点赞量排列的产品列表
@@ -64,6 +64,7 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
console.log('产品列表2', res.data);
let tags = res.data.data
for (const item of tags) {
let tag = item.tags

View File

@@ -11,7 +11,7 @@
</u-image>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 22rpx;">
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<text class="title">{{item.name}}</text>
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
@@ -38,7 +38,7 @@
export default {
data() {
return {
imgUrl: '',
imgUrl: null,
tagsArray: [],
productList: [],
pageNum: 1, // 当前页
@@ -47,15 +47,8 @@
}
},
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.getProductsByTime()
},
methods: {
//获取按上架时间排列的产品列表
@@ -65,17 +58,21 @@
pageSize: this.pageSize,
pageNum: this.pageNum
}).then(res => {
console.log('产品列表1', res.data);
let tags = res.data.data
for (const item of tags) {
let tag = item.tags
this.tagsArray = tag.split(',')
item.tags = this.tagsArray[0]
if (tags) {
for (const item of tags) {
let tag = item.tags
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(_ => {
})

View File

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

View File

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

18
package-lock.json generated
View File

@@ -2,25 +2,11 @@
"name": "pupil",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"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"
}
}
},
"lockfileVersion": 1,
"dependencies": {
"uview-ui": {
"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=="
}
}

View File

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

View File

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

View File

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

View File

@@ -3,13 +3,14 @@
<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>
<myAvatar :center="show"></myAvatar>
<myAvatar ref="myavatar" :center="show"></myAvatar>
<view style="height: 56rpx;"></view>
<myForm ref="nameAndphone"></myForm>
<view class="commitment">
{{commitment}}
</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">
<rich-text :nodes="content"></rich-text>
</u-modal>
@@ -23,43 +24,79 @@
name: '',
phone: '',
showM: false,
btnText: '升级VIP',
btnDisabled: false,
//部分产品无权限访问需升级VIP
needAsk: '',
//会员中心的用户名旁边不显示edit图标
show: false,
content: `请保持手机畅通<br>
客服会及时联系您`,
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置'
commitment: ''
}
},
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) {
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: {
handleSureClick() {
let name = this.$refs.nameAndphone.model.userInfo.name
let phone = this.$refs.nameAndphone.model.userInfo.phone
this.$apiServe.bindComponyAndUpdate({
uid: 1,
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('请完善数据')
if (this.btnDisabled == false) {
let name = this.$refs.nameAndphone.model.userInfo.name
let phone = this.$refs.nameAndphone.model.userInfo.phone
console.log('name', name);
console.log('phone', phone);
if (!/^1[3456789]\d{9}$/.test(phone)) {
this.$toast.warn('请输入正确的手机号')
return false
}
}).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() {
this.showM = false
uni.reLaunch({
url: '/pages/my/my'
})
if (this.needAsk == 1) {
uni.switchTab({
uni.reLaunch({
url: '/pages/index/index'
})
}

View File

@@ -11,14 +11,19 @@
<view class="time_line">
<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 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>
<text class="btn_text">修改</text>
</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>
<text class="btn_text">删除</text>
</view>
@@ -32,14 +37,20 @@
<text class="needs_text">{{item.pname}}</text>
<view class="time_line">
<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 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>
<text class="btn_text">修改</text>
</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>
<text class="btn_text">删除</text>
</view>
@@ -74,27 +85,28 @@
name: '创意发布'
}],
needsList: [],
ideasList: []
ideasList: [],
updateIndex: ''
}
},
onLoad(options) {
console.log(options)
if(options && options.index) {
console.log(options)
if (options && options.index) {
options.index = options.index - 1
this.updateIndex = options.index
this.tabChange(options)
return
}
this.getIdeasAndNeeds()
},
methods: {
//获取创意发布
//获取创意发布或需求发布
getIdeasAndNeeds() {
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
console.log('获取创意发布&需求发布', res.data.data);
let data = res.data.data
console.log('创意需求发布数据', res.data);
for (const item of data) {
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(';') : []
item.images = imagesList.map(item1 => {
item1 = uni.getStorageSync('img_url') + '/' + item1
@@ -113,7 +125,6 @@
//切换需求发布和创意发布
tabChange(data) {
this.tabCurrent = data.index
// console.log('data.index', data.index);
if (data.index == 0) {
this.type = 1
} else if (data.index == 1) {
@@ -121,17 +132,32 @@
}
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) {
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
})
}
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
})
}
})
},
//二次确认删除我的需求或创意
@@ -143,7 +169,6 @@
success: function(res) {
if (res.confirm) {
that.$apiServe.deleteIdeasAndNeeds(item.id).then(res => {
// console.log('删除发布', res);
if (res.data.code == 1) {
that.$toast.warn('删除成功')
}

View File

@@ -1,7 +1,21 @@
<template>
<view>
<certifiedCj></certifiedCj>
<view v-if="cjsShow" class="no-data">已经到底啦</view>
<view class="xw_content" v-for="(item,index) in cjsList" :key="index" @click="clickCj(item)">
<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>
</template>
@@ -9,11 +23,46 @@
export default {
data() {
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: {
// 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>

View File

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

View File

@@ -1,6 +1,9 @@
<template>
<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>
</template>
@@ -8,11 +11,22 @@
export default {
data() {
return {
reachBottomLength: ''
}
},
onReachBottom() {
this.$refs.productsByTime.pageNum++
this.$refs.productsByTime.getProductsByTime()
},
onLoad() {
this.$refs.productsByTime.pageSize = 2
this.$refs.productsByTime.getProductsByTime()
},
methods: {
//获取按上架时间排列的产品列表length
getTimeLength(e) {
this.reachBottomLength = e
}
}
}
</script>

View File

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

View File

@@ -1,22 +1,73 @@
<template>
<view>
<news></news>
<view v-if="newsShow" class="no-data">已经到底啦</view>
<view class="xw_content" v-for="(item,index) in newsList" :key="index" @click="clickNews(item)">
<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>
</template>
<script>
import {
dateFormat
} from '../../utills/date.js'
export default {
data() {
return {
newsShow: true,
newsShow: '',
imgUrl: '',
newsList: [],
pageNum: 1, // 当前页
pageSize: 12, // 每页条数
}
},
onLoad() {
this.imgUrl = uni.getStorageSync('img_url')
this.getNews()
},
onReachBottom() {
console.log('触底下拉');
if (this.newsShow !== 0) {
this.pageNum++
this.getNews()
}
},
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>

View File

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

View File

@@ -7,14 +7,14 @@
</u-image>
<view class="bgContent">
<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>
<view class="img_tag">{{item.cate_name}}</view>
</view>
<view style="padding: 14rpx 22rpx;">
<view style="padding: 14rpx 24rpx 14rpx 16rpx;">
<view class="title_box">
<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 class="product_desc">
{{item.title}}
@@ -24,7 +24,7 @@
:lazy-load="true">
</u-image>
<text class="release">发布日期</text>
<text>{{item.pub_time}}</text>
<text>{{item.pub_time_str}}</text>
</view>
</view>
</view>
@@ -43,10 +43,13 @@
pageNum: 1
},
queryTitle: null,
productList: []
imgUrl: null,
productList: [],
tagsArray: [],
}
},
onLoad(options) {
this.imgUrl = uni.getStorageSync('img_url')
this.queryTitle = options.title
this.goSearch()
},
@@ -56,8 +59,17 @@
...this.queryParam,
title: this.queryTitle
}
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(_ => {})
},
//点击图片跳转到详情页

View File

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

View File

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

View File

@@ -1,21 +1,24 @@
<template>
<view>
<view :key="index">
<view style="position: relative;padding-bottom: 100rpx;">
<u-image :src="imgUrl+detailList.cover" width="750rpx" height="530rpx">
</u-image>
<view class="collect" @click="starTap">
<view class="collect" v-if="detailList.is_fav==0||!detailList.is_fav" @click="starTap">
<view class="star">
<u-image v-if="detailList.is_fav==0||!detailList.is_fav" src="/static/detail/xp_icon_wstar.png"
width="28rpx" height="28rpx">
</u-image>
<u-image v-if="detailList.is_fav==1" src="/static/detail/xp_icon_star.png" width="28rpx"
height="28rpx">
<u-image src="/static/detail/xp_icon_wstar.png" width="28rpx" height="28rpx">
</u-image>
</view>
<u-image src="/static/detail/xiangqing_icon_shoucang.png" width="119rpx" height="48rpx">
</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>
</view>
<u-image src="/static/detail/xiangqing_icon_shoucang.png" width="119rpx" height="48rpx">
</u-image>
</view>
<view class="content">
<view class="title_box">
<text class="title">{{detailList.name}}</text>
@@ -31,19 +34,33 @@
<view>
<text class="tagOne" v-for="item in detailList.tags" :key="item.id">{{item}}</text>
</view>
<!-- thumb有值显示数字+ -->
<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>
<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 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>
<!-- thumb无值显示点赞二字 用户进行一次点赞之后显示1赞-->
<view v-else class="heart">
<view v-if="detailList.is_thumb==0" style="display: flex;">
<u-image src="/static/detail/xp_icon_heart.png" width="34rpx" height="32rpx"
@click="heartTap">
</u-image>
<text class="thumb" @click="heartTap">点赞</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>
@@ -54,16 +71,32 @@
<text class="release">发布日期</text>
<text>{{detailList.pub_time}}</text>
</view>
<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;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
<login :timoutText="timoutText" @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
<u-modal :show="showM" :content='content' closeOnClickOverlay="false" showCancelButton="true"
confirmText="升级VIP" @confirm="confirm" confirmColor="#0EBB5B">
<rich-text :nodes="content"></rich-text>
<u-modal :show="showUpdate" :content='content' closeOnClickOverlay="false" showCancelButton="true"
confirmText="升级VIP" @confirm="confirm" @cancel="cancel" confirmColor="#0EBB5B">
<rich-text :nodes="updateContent"></rich-text>
</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>
</template>
@@ -81,76 +114,120 @@
return {
id: '',
imgUrl: '',
tagsArray: [],
showHeart: false,
detailList: [],
isLoad: true,
showM: false,
content: '您暂无权限访问请升级VIP访问'
showUpdate: false,
showUpdating: false,
showCall: false,
mobile: '',
updateContent: '您暂无权限访问请升级VIP访问',
updatingContent: '升级VIP正在审核中',
timoutText: 1
}
},
onLoad(option) {
this.imgUrl = uni.getStorageSync('img_url')
this.id = option.id
this.getProductDetail()
this.imgUrl = uni.getStorageSync('img_url')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
this.isLoad = false
// uni.navigateTo({
// url: '../../pages/my/login/login'
// })
return
}
this.isLoad = true
this.getCsTel()
},
methods: {
//获取客服电话
getCsTel() {
this.$apiServe.getCsTel().then(res => {
this.mobile = res.data.data.cs_tel
}).finally(_ => {})
},
//获取详情信息
getProductDetail() {
this.$apiServe.getProductDetail(this.id).then(res => {
console.log('产品详情', res.data)
if (res.data.data.thumb) {
this.isThumb = true
console.log('产品详情', res);
let detail = res.data.data
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) {
let detail = res.data.data
//跳转到升级VIP页面
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)
let tag = detail.tags
this.tagsArray = tag.split(',')
detail.tags = this.tagsArray
this.detailList = res.data.data
} else {
this.$toast.warn('没有更多详情了')
if (detail.tags) {
detail.tags = detail.tags.split(',')
}
// if (detail.is_thumb == 1 && parseInt(detail.thumb) == 1 && parseInt(detail
// .thumbcount) == 1) {
// console.log('222');
// detail.thumb = parseInt(detail.thumbcount)
// } else {
detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount)
// }
this.detailList = detail
}
}).finally(_ => {})
},
//收藏按钮
//点击star收藏
starTap() {
if (this.detailList.is_fav === 1) {
this.$toast.warn('已收藏')
} else if (this.detailList.is_fav === 0) {
if (!uni.getStorageSync('loginToken')) {
this.$toast.warn('请登录后操作')
} else {
this.$apiServe.collect(this.id).then(res => {
// console.log('收藏成功', res.data)
if (res.data.code == 1) {
this.detailList.is_fav = 1
this.$toast.warn('收藏成功')
this.getProductDetail()
} else {
this.$toast.warn('收藏失败')
}
}).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() {
// this.showHeart = !this.showHeart
this.$apiServe.thumb(this.id).then(res => {
console.log('点赞成功', res.data)
if (!uni.getStorageSync('loginToken')) {
this.$toast.warn('请登录后操作')
} 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) {
this.showHeart = 1
this.$toast.warn('点赞成功')
this.getProductDetail()
this.$toast.warn('取消点赞')
} else {
this.$toast.warn('点赞失败')
this.$toast.warn('取消点赞失败')
}
}).finally(_ => {})
},
@@ -167,12 +244,40 @@
this.getProductDetail()
},
failToLoad() {
this.$toast.warn('登录失败请重试')
uni.reLaunch({
url: '/pages/index/index'
})
},
confirm() {
uni.navigateTo({
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;
align-items: center;
padding: 24rpx 20rpx;
margin-top: 20rpx;
margin: 20rpx 0;
background-color: #fff;
.release {
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>

View File

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

View File

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

View File

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

View File

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

View File

@@ -21,7 +21,7 @@
<news></news>
</view>
<!-- 新品发布 -->
<!-- 企业需求 -->
<view>
<view class="subtitle">
<u--image src="/static/report/hy_icon_fux.png" width="24rpx" height="24rpx" :lazy-load="true">
@@ -32,7 +32,7 @@
</view>
<!-- 认证厂家 -->
<view>
<view v-if="token==true">
<view class="subtitle">
<u--image src="/static/report/hy_icon_cjx.png" width="24rpx" height="24rpx" :lazy-load="true">
</u--image>
@@ -40,13 +40,24 @@
</view>
<certifiedCj></certifiedCj>
</view>
<view style="margin:0 20rpx;">
<u-overlay :show="!isLoad">
<login @success="reOnLoad()" @fail="failToLoad()"></login>
</u-overlay>
</view>
</view>
</template>
<script>
import login from 'pages/my/login/login'
export default {
components: {
login
},
data() {
return {
isLoad: true,
token: '',
classifyList: [{
src: '/static/report/hy_icon_xw.png',
title: '行业新闻'
@@ -60,7 +71,16 @@
title: '认证厂家'
},
],
}
},
onLoad() {
if (uni.getStorageSync('loginToken')) {
this.token = true
}
},
onShow() {
if (uni.getStorageSync('loginToken')) {
this.token = true
}
},
methods: {
@@ -76,12 +96,33 @@
url: '../../packageReport/newProductRelease/newProductRelease'
})
} 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({
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) {
if (res.data.message === '请先登录') {
uni.showToast('登录信息已过期,请重新登录')
@@ -205,7 +205,7 @@ const toast = {
}
}
const apiService = {
uploadImgUrl: serverHost + `/upload/image/`,
uploadImgUrl: serverHost + `/upload/image/`,
imgUrl: serverHost,
// login: data => {
// data = Object.assign(data || {}, {})
@@ -243,10 +243,10 @@ const apiService = {
})
},
// 获取行业新闻
getNews() {
const url = `/news/nlists/?pageSize=50&pageNum=1`
getNews(data) {
const url = `/news/nlists`
return new Promise((resolve, reject) => {
resolve(service.get(url))
resolve(service.get(url, data))
})
},
// 获取行业新闻详情
@@ -257,10 +257,10 @@ const apiService = {
})
},
// 获取认证厂家列表
getCertifiedCj() {
const url = `/news/flists?pageSize=50&pageNum=1`
getCertifiedCj(data) {
const url = `/news/flists`
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))
})
},
//取消(清除)点赞
cancelThumb(id) {
const url = `/center/thumbcls/?id=${id}`
return new Promise((resolve, reject) => {
resolve(service.post(url, id))
})
},
//获取个人信息
getUser() {
const url = `/center/userinfo`
@@ -333,6 +340,13 @@ const apiService = {
resolve(service.post(url, data))
})
},
// 获取客服电话
getCsTel() {
const url = `/center/cfg?key=cs_tel`
return new Promise((resolve, reject) => {
resolve(service.get(url))
})
},
// 获取首页分类Tag
getTags(data) {
const url = `/home/tags`

View File

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

View File

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