Merge pull request 'dengjie' (#85) from dengjie into dev
Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/85
This commit is contained in:
@@ -10,14 +10,14 @@
|
|||||||
</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>
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
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,31 @@
|
|||||||
//获取头像昵称和普通会员和VIP会员
|
//获取头像昵称和普通会员和VIP会员
|
||||||
getUser() {
|
getUser() {
|
||||||
this.$apiServe.getUser().then(res => {
|
this.$apiServe.getUser().then(res => {
|
||||||
console.log('个人信息==', res.data);
|
// console.log('个人信息==', res.data);
|
||||||
if (res.data.msg == "登录超时,请重新登录") {
|
if (res.data.msg === "登录超时,请重新登录") {
|
||||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
this.isLoad = false
|
||||||
this.$toast.warn('登录失败请重试')
|
|
||||||
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
|
this.avatar = uni.getStorageSync('img_url') + data.avatar
|
||||||
this.nickname = data.nickname
|
this.nickname = data.nickname
|
||||||
this.member = data.member
|
this.member = data.member
|
||||||
|
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('登录失败请重试')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,10 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
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>
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
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
|
||||||
|
console.log('历史记录或收藏', data);
|
||||||
for (const item of data) {
|
for (const item of data) {
|
||||||
let tag = item.tags
|
let tag = item.tags
|
||||||
this.tagsArray = tag.split(',')
|
this.tagsArray = tag.split(',')
|
||||||
@@ -81,7 +82,6 @@
|
|||||||
item.create_time = dateFormatHistory(item.create_time)
|
item.create_time = dateFormatHistory(item.create_time)
|
||||||
}
|
}
|
||||||
this.productList = data
|
this.productList = data
|
||||||
console.log('获取历史记录', this.productList);
|
|
||||||
}).finally(_ => {
|
}).finally(_ => {
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -40,9 +40,8 @@
|
|||||||
//获取头像昵称
|
//获取头像昵称
|
||||||
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
|
this.avatar = uni.getStorageSync('img_url') + data.avatar
|
||||||
this.model.userInfo.name = data.nickname
|
this.model.userInfo.name = data.nickname
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
@@ -58,10 +57,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)
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
console.log(options)
|
console.log(options)
|
||||||
if(options && options.index) {
|
if (options && options.index) {
|
||||||
console.log(options)
|
console.log(options)
|
||||||
options.index = options.index - 1
|
options.index = options.index - 1
|
||||||
this.tabChange(options)
|
this.tabChange(options)
|
||||||
@@ -91,7 +91,6 @@
|
|||||||
//获取创意发布
|
//获取创意发布
|
||||||
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
|
||||||
for (const item of data) {
|
for (const item of data) {
|
||||||
item.pub_time = dateFormatXwDetail(item.pub_time)
|
item.pub_time = dateFormatXwDetail(item.pub_time)
|
||||||
@@ -123,15 +122,16 @@
|
|||||||
},
|
},
|
||||||
//修改我的需求
|
//修改我的需求
|
||||||
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
|
||||||
}
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//二次确认删除我的需求或创意
|
//二次确认删除我的需求或创意
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<u-modal :show="showCall" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
|
<u-modal :show="showCall" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
|
||||||
@confirm="confirmCall" @cancel="cancelCall">
|
@confirm="confirmCall" @cancel="cancelCall">
|
||||||
<view>
|
<view>
|
||||||
<view>{{phone}}</view>
|
<view style="text-indent: 25rpx;">{{mobile}}</view>
|
||||||
<text>是否拨打客服电话</text>
|
<text>是否拨打客服电话</text>
|
||||||
</view>
|
</view>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
@@ -53,12 +53,13 @@
|
|||||||
imgUrl: '',
|
imgUrl: '',
|
||||||
isLoad: true,
|
isLoad: true,
|
||||||
showCall: false,
|
showCall: false,
|
||||||
phone: '138 1222 222',
|
mobile: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.id = option.id
|
this.id = option.id
|
||||||
this.getCertifiedCjDetail()
|
this.getCertifiedCjDetail()
|
||||||
|
this.getCsTel()
|
||||||
this.imgUrl = uni.getStorageSync('img_url')
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||||
this.isLoad = false
|
this.isLoad = false
|
||||||
@@ -67,6 +68,12 @@
|
|||||||
this.isLoad = true
|
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 => {
|
||||||
@@ -100,7 +107,8 @@
|
|||||||
},
|
},
|
||||||
confirmCall() {
|
confirmCall() {
|
||||||
this.showCall = false
|
this.showCall = false
|
||||||
let phone = '1381222222'
|
let phone = this.mobile
|
||||||
|
phone = phone.toString()
|
||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: phone,
|
phoneNumber: phone,
|
||||||
success: function() {
|
success: function() {
|
||||||
@@ -119,6 +127,11 @@
|
|||||||
</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;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<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="collect" v-if="detailList.is_fav==1" @click="cancelStarTap(detailList.id)">
|
<view class="collect" v-if="detailList.is_fav==1" @click="cancelStarTap(detailList.fav_id)">
|
||||||
<view class="star">
|
<view class="star">
|
||||||
<u-image src="/static/detail/xp_icon_star.png" width="28rpx" height="28rpx">
|
<u-image src="/static/detail/xp_icon_star.png" width="28rpx" height="28rpx">
|
||||||
</u-image>
|
</u-image>
|
||||||
@@ -34,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">
|
||||||
</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">
|
||||||
|
<!-- 用户是否点赞字段 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>
|
||||||
@@ -65,7 +79,7 @@
|
|||||||
<u-modal :show="showCall" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
|
<u-modal :show="showCall" showCancelButton closeOnClickOverlay="false" confirmText="是" cancelText="否"
|
||||||
@confirm="confirmCall" @cancel="cancelCall">
|
@confirm="confirmCall" @cancel="cancelCall">
|
||||||
<view>
|
<view>
|
||||||
<view>{{phone}}</view>
|
<view style="text-indent: 25rpx;">{{mobile}}</view>
|
||||||
<text>是否拨打客服电话</text>
|
<text>是否拨打客服电话</text>
|
||||||
</view>
|
</view>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
@@ -75,7 +89,7 @@
|
|||||||
</u-overlay>
|
</u-overlay>
|
||||||
</view>
|
</view>
|
||||||
<u-modal :show="showM" :content='content' closeOnClickOverlay="false" showCancelButton="true"
|
<u-modal :show="showM" :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="content"></rich-text>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
</view>
|
</view>
|
||||||
@@ -100,31 +114,32 @@
|
|||||||
isLoad: true,
|
isLoad: true,
|
||||||
showM: false,
|
showM: false,
|
||||||
showCall: false,
|
showCall: false,
|
||||||
phone: '138 1222 222',
|
mobile: '',
|
||||||
content: '您暂无权限访问,请升级VIP访问'
|
content: '您暂无权限访问,请升级VIP访问'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.id = option.id
|
this.id = option.id
|
||||||
this.getProductDetail()
|
this.getProductDetail()
|
||||||
|
this.getCsTel()
|
||||||
this.imgUrl = uni.getStorageSync('img_url')
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
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
|
||||||
},
|
},
|
||||||
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.data);
|
||||||
if (res.data.data.thumb) {
|
|
||||||
this.isThumb = true
|
|
||||||
}
|
|
||||||
if (res.data.msg == "没有权限访问" && uni.getStorageSync('loginToken')) {
|
if (res.data.msg == "没有权限访问" && uni.getStorageSync('loginToken')) {
|
||||||
this.showM = true
|
this.showM = true
|
||||||
}
|
}
|
||||||
@@ -132,16 +147,21 @@
|
|||||||
let detail = res.data.data
|
let detail = res.data.data
|
||||||
detail.pub_time = dateFormatDetail(detail.pub_time)
|
detail.pub_time = dateFormatDetail(detail.pub_time)
|
||||||
detail.tags = detail.tags.split(',')
|
detail.tags = detail.tags.split(',')
|
||||||
|
if (detail.is_thumb == 1) {
|
||||||
|
detail.thumb = parseInt(detail.thumb) + parseInt(detail.thumbcount)
|
||||||
|
} else {
|
||||||
|
detail.thumb = parseInt(detail.thumb) - parseInt(detail.thumbcount)
|
||||||
|
}
|
||||||
this.detailList = detail
|
this.detailList = detail
|
||||||
} else {
|
|
||||||
this.$toast.warn('没有更多详情了')
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// this.$toast.warn('没有更多详情了')
|
||||||
|
// }
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
//点击star收藏
|
//点击star收藏
|
||||||
starTap() {
|
starTap() {
|
||||||
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.$toast.warn('收藏成功')
|
this.$toast.warn('收藏成功')
|
||||||
this.getProductDetail()
|
this.getProductDetail()
|
||||||
@@ -151,31 +171,38 @@
|
|||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
//点击star取消收藏
|
//点击star取消收藏
|
||||||
cancelStarTap(id) {
|
cancelStarTap(fav_id) {
|
||||||
// console.log('this.detailList.id', id);
|
this.$apiServe.deleteHistoryOrCollection(fav_id).then(res => {
|
||||||
// this.$apiServe.deleteHistoryOrCollection(id).then(res => {
|
if (res.data.code == 1) {
|
||||||
// console.log('取消收藏', res.data);
|
this.$toast.warn('取消收藏')
|
||||||
// // if (res.data.code == 1) {
|
this.getProductDetail()
|
||||||
// // this.$toast.warn('取消收藏')
|
} else {
|
||||||
// // this.getProductDetail()
|
this.$toast.warn('取消收藏失败')
|
||||||
// // } else {
|
}
|
||||||
// // this.$toast.warn('收藏失败')
|
}).finally(_ => {})
|
||||||
// // }
|
|
||||||
// }).finally(_ => {})
|
|
||||||
},
|
},
|
||||||
//点赞按钮
|
//点赞按钮
|
||||||
heartTap() {
|
heartTap() {
|
||||||
// this.showHeart = !this.showHeart
|
|
||||||
this.$apiServe.thumb(this.id).then(res => {
|
this.$apiServe.thumb(this.id).then(res => {
|
||||||
console.log('点赞成功', res.data)
|
|
||||||
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(_ => {})
|
||||||
},
|
},
|
||||||
|
//取消点赞
|
||||||
|
cancelHeartTap(thumb_id) {
|
||||||
|
this.$apiServe.cancelThumb(thumb_id).then(res => {
|
||||||
|
if (res.data.code == 1) {
|
||||||
|
this.getProductDetail()
|
||||||
|
this.$toast.warn('取消点赞')
|
||||||
|
} else {
|
||||||
|
this.$toast.warn('取消点赞失败')
|
||||||
|
}
|
||||||
|
}).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('登录失败请重试')
|
||||||
@@ -198,13 +225,19 @@
|
|||||||
url: '../../../packageMy/memberCenter/memberCenter?ask=' + 1
|
url: '../../../packageMy/memberCenter/memberCenter?ask=' + 1
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
cancel() {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
// 联系客服模态框
|
// 联系客服模态框
|
||||||
showModal() {
|
showModal() {
|
||||||
this.showCall = true
|
this.showCall = true
|
||||||
},
|
},
|
||||||
confirmCall() {
|
confirmCall() {
|
||||||
this.showCall = false
|
this.showCall = false
|
||||||
let phone = '1381222222'
|
let phone = this.mobile
|
||||||
|
phone = phone.toString()
|
||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: phone,
|
phoneNumber: phone,
|
||||||
success: function() {
|
success: function() {
|
||||||
@@ -223,6 +256,11 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
// .u-modal__content {
|
||||||
|
// padding: 43rpx 104rpx !important;
|
||||||
|
// text-indent: 25rpx;
|
||||||
|
// }
|
||||||
|
|
||||||
.collect {
|
.collect {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -76,32 +76,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// this.login()
|
|
||||||
this.getCategories()
|
this.getCategories()
|
||||||
this.getBanner()
|
this.getBanner()
|
||||||
this.getImgUrl()
|
this.getImgUrl()
|
||||||
this.imgUrl = uni.getStorageSync('img_url')
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
},
|
},
|
||||||
methods: {
|
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);
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
//获取按上架时间排列的产品列表length
|
//获取按上架时间排列的产品列表length
|
||||||
getTimeLength(e) {
|
getTimeLength(e) {
|
||||||
this.reachBottomLength = e
|
this.reachBottomLength = e
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
<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"
|
||||||
@@ -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,8 +49,9 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showM: false,
|
showM: false,
|
||||||
phone: '138 1222 222',
|
mobile: '',
|
||||||
isLoad: true,
|
isLoad: true,
|
||||||
|
is_bind: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onTabItemTap() {
|
onTabItemTap() {
|
||||||
@@ -58,7 +62,19 @@
|
|||||||
}
|
}
|
||||||
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 => {
|
||||||
|
this.mobile = res.data.data.cs_tel
|
||||||
|
}).finally(_ => {})
|
||||||
|
},
|
||||||
//跳转到绑定公司页面
|
//跳转到绑定公司页面
|
||||||
bindCompany() {
|
bindCompany() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -95,7 +111,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() {
|
||||||
@@ -109,9 +126,6 @@
|
|||||||
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('登录失败请重试')
|
||||||
|
|||||||
@@ -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`
|
||||||
|
|||||||
@@ -16,16 +16,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.my_avatar {
|
.my_avatar {
|
||||||
margin-top: -200rpx;
|
margin-top: -184rpx;
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user