作者 倪静楠

3/16

{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"type": "uniCloud",
"default": {
"launchtype": "remote"
}
}
]
}
... ...
... ... @@ -7,8 +7,9 @@ export default {
console.log('App Show');
},
onHide: function() {
console.log('App Hide');
}
console.log('App Hide',' 退出’');
uni.setStorageSync('changeAddessShow',true)
},
};
</script>
... ...
... ... @@ -211,6 +211,8 @@
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
padding-left: 104rpx;
box-sizing: border-box;
}
.messageMain {
... ...
... ... @@ -135,7 +135,6 @@
}
.meBot1 {
width: 686rpx;
height: 438rpx;
background-color: #FFFFFF;
margin-bottom:100rpx;
}
... ...
... ... @@ -19,14 +19,14 @@
<image src="/static/image/Frame_9@2x.png" mode=""></image>
{{goodsData.num}}
</view>
<!-- <view class="public">
<view class="public">
<image src="/static/image/Frame_9@2x.png" mode=""></image>
{{goodsData.time2}}
</view>
<view class="public">
<image src="/static/image/Frame_9@2x.png" mode=""></image>
<text v-html="goodsData.address"></text>
</view> -->
{{goodsData.address}}
</view>
</view>
<view class="goodsPic">
<rich-text :nodes="content"></rich-text>
... ...
<template>
<view class="" style="background-color: #f7f8fa; width: 100%;padding-bottom: 424rpx;" v-if="goodsData.num">
<view class="">
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration"
:circular="true">
<swiper-item v-for="(item,index) in swiperList" :key="index">
<image :src="item" mode="" class="swiper" style="height: 100%;" ></image>
<view class="swiperLength">
{{index+1}}/{{swiperList.length}}
</view>
</swiper-item>
</swiper>
</view>
<view class="goodDetail">
<view class="title">
{{goodsData.convert_name}}
</view>
<view class="public">
<image src="/static/image/Frame_9@2x.png" mode=""></image>
{{goodsData.num}}
</view>
<!-- <view class="public">
<image src="/static/image/Frame_9@2x.png" mode=""></image>
{{goodsData.time2}}
</view>
<view class="public">
<image src="/static/image/Frame_9@2x.png" mode=""></image>
<text v-html="goodsData.address"></text>
</view> -->
</view>
<view class="goodsPic">
<rich-text :nodes="content"></rich-text>
<!-- <image src="https://s3.ax1x.com/2021/01/11/s8Psw6.png" mode=""></image> -->
</view>
<view class="btnBj">
<view class="" style="height: 242rpx;background: #ffffff;margin-top: 16rpx;border-bottom: 16rpx solid #f7f8fa;">
<view class="" style="margin: 24rpx 0 32rpx 32rpx;">
<text>我的报名信息</text>
</view>
<view class="" style="padding:14rpx 32rpx;">
<text class="cluNavTexts">报名人</text>
<text class="sterNavText">{{userData.name}}</text>
</view>
<view class="" style="padding:14rpx 32rpx;">
<text class="cluNavText">联系方式</text>
<text class="sterNavText">{{userData.phone}}</text>
</view>
</view>
<view class="" style="height: 152rpx;background: #ffffff; display: flex;flex-direction: column;">
<view class="" style="margin: 14rpx 32rpx;">
<text class="cluNavText">订单编号</text>
<text class="sterNavText">{{userData.order_no}}</text>
</view>
<view class="" style="margin: 14rpx 32rpx;">
<text class="cluNavText">下单时间</text>
<text class="sterNavText">{{userData.createtime}}</text>
</view>
</view>
</view>
</view>
</template>
<script>
import request from '../../../utils/request.js'
export default {
onLoad(options) {
this.id = options.id
this.tabindex=options.index
this.goodsDetail()
},
data() {
return {
tabindex:'', //判断活动/商品
id: '',
indicatorDots: true,
autoplay: false,
duration: 1000,
swiperList: [],
goodsData: {},
userData:'',
content:''
}
},
methods: {
//立即报名
immediately() {
uni.navigateTo({
url: "/pages/activity/apply"
})
},
//兑换商品详情
goodsDetail(){
let dataParam = {
id: this.id
}
request.get('/api/convert/duiDetail', dataParam).then(res => {
this.swiperList = res.data.convert_list.images
this.goodsData = res.data.convert_list
this.userData=res.data
var richtext = res.data.convert_list.content
const regex = new RegExp('<img', 'gi');
richtext = richtext.replace(regex, `<img style="max-width: 100%;display:block"`)
this.content = richtext
}).catch(err => {
})
}
}
}
</script>
<style>
.swiper {
width: 100%;
position: relative;
}
.swiperLength {
position: absolute;
bottom: 54rpx;
right: 32rpx;
width: 64rpx;
height: 40rpx;
opacity: 0.4;
background: #000000;
font-size: 20rpx;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
border-radius: 40rpx;
}
.goodDetail {
background-color: #fff;
padding: 38rpx 32rpx;
box-sizing: border-box;
border-radius: 40rpx 40rpx 0px 0px;
position: relative;
z-index: 9;
margin-top: -40rpx;
margin-bottom: 24rpx;
}
.title {
font-size: 32rpx;
font-weight: 500;
text-align: LEFT;
color: #323233;
line-height: 48rpx;
padding: 10rpx 0;
}
.public {
padding: 10rpx 0;
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: 400;
text-align: LEFT;
color: #646566;
max-width: 520rpx;
text-overflow: ellipsis;
overflow: hidden;
}
.public image {
width: 32rpx;
height: 32rpx;
margin-right: 18rpx;
}
.btnBj {
width: 100%;
height: 424rpx;
position: fixed;
bottom: 0;
left: 0;
background-color: #fff;
padding-bottom: 20rpx;
}
.cluNavText {
color: #879099;
font-size: 26rpx;
margin-right: 45rpx;
}
.cluNavTexts {
color: #879099;
font-size: 26rpx;
margin-right: 75rpx;
}
.sterNavText {
color: #22272B;
font-size: 26rpx;
}
.btn {
width: 90%;
height: 62%;
background: #ff834d;
border-radius: 48rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #fff;
}
</style>
... ...
... ... @@ -119,9 +119,8 @@
},
//商品
goGroupDetail(id) {
console.log(id)
uni.navigateTo({
url:'/myPackage/pages/me/cluster?id='+id+'&index=2'
url:'/myPackage/pages/me/exchang-order-detail?id='+id+'&index=2'
})
}
},
... ...
... ... @@ -9,9 +9,11 @@
</view>
</view>
<view class="issueBottom" v-if="index == 0">
<view class="issueBottomNav" v-for="(item,index) in dataList" :key="index" @click="goGoodsDetail(item.goods_id)">
<view class="issueBottomNav" v-for="(item,index) in dataList" :key="index"
@click="goGoodsDetail(item.goods_id)">
<view class="issueBottomImg">
<image :src="item.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode=""></image>
<image :src="item.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode="">
</image>
</view>
<view class="issueBottomRight">
<view class="issueBottomRightText issueBox">
... ... @@ -21,9 +23,10 @@
<view class="issueBottomColor">
<text class="issueBottomFu">¥</text><text class="issueBottomQian">{{item.price}}</text>
</view>
<view style="margin-right: 56rpx;display: flex;align-items: center;" @click.stop="del(item.goods_id)">
<image src="../../static/image/shanchu_icon_1@2x.png" style="width: 24rpx;height: 25rpx;margin-right: 6rpx;"
mode=""></image>
<view style="margin-right: 56rpx;display: flex;align-items: center;"
@click.stop="del(item.goods_id)">
<image src="../../static/image/shanchu_icon_1@2x.png"
style="width: 24rpx;height: 25rpx;margin-right: 6rpx;" mode=""></image>
<text class="issueBottomDel">删除</text>
</view>
</view>
... ... @@ -33,7 +36,8 @@
<view class="issueBottom" v-if="index == 1">
<view class="issueBottomNav" v-for="(item,index) in dataList1" :key="index" @click="goNeedsDetail(item.id)">
<view class="issueBottomImg">
<image :src="item.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode=""></image>
<image :src="item.images[0]" style="width: 200rpx;height: 200rpx;border-radius: 16rpx;" mode="">
</image>
</view>
<view class="issueBottomRight">
<view class="issueBottomRightText">
... ... @@ -43,18 +47,20 @@
<view class="issueBottomColor">
<text class="issueBottomFu">¥</text><text class="issueBottomQian">{{item.price}}</text>
</view>
<view style="margin-right: 56rpx;display: flex;align-items: center;" @click.stop="delNeed(item.id)">
<image src="../../static/image/shanchu_icon_1@2x.png" style="width: 24rpx;height: 25rpx;margin-right: 6rpx;"
mode=""></image>
<view style="margin-right: 56rpx;display: flex;align-items: center;"
@click.stop="delNeed(item.id)">
<image src="../../static/image/shanchu_icon_1@2x.png"
style="width: 24rpx;height: 25rpx;margin-right: 6rpx;" mode=""></image>
<text class="issueBottomDel">删除</text>
</view>
</view>
</view>
</view>
</view>
<view class="" v-if="index==1&&dataList.length==0||index==2&&dataList1.length==0" style="text-align: center;margin-top: 200rpx;color: grey;">
暂无数据
</view>
<view class="" v-if="index==1&&dataList.length==0||index==2&&dataList1.length==0"
style="text-align: center;margin-top: 200rpx;color: grey;">
暂无数据
</view>
</view>
</template>
... ... @@ -85,15 +91,15 @@
//发布商品
commodity() {
this.index = 0;
this.pageNum=1
this.pageNum = 1
this.listData()
},
listData(url) {
request.get('/api/personal/pushGoods', {
page:this.pageNum,
rows:10
page: this.pageNum,
rows: 10
}).then(res => {
let list = this.pageNum == 1 ? res.data.info.data: this.list.concat(res.data.info.data);
let list = this.pageNum == 1 ? res.data.info.data : this.list.concat(res.data.info.data);
this.dataList = list.reverse()
}).catch(err => {
... ... @@ -107,16 +113,16 @@
//发布需求
demand() {
this.index = 1;
this.pageNum=1
this.pageNum = 1
this.listData1()
},
listData1() {
request.get('/api/personal/pushNeed', {
page:this.pageNum,
rows:10
page: this.pageNum,
rows: 10
}).then(res => {
let list = this.pageNum == 1 ? res.data.info.data: this.list.concat(res.data.info.data);
this.dataList1 =list.reverse()
let list = this.pageNum == 1 ? res.data.info.data : this.list.concat(res.data.info.data);
this.dataList1 = list.reverse()
}).catch(err => {
})
... ... @@ -128,6 +134,7 @@
},
//删除发布商品
del(id, index) {
let that = this
uni.showModal({
title: '提示',
content: '确认删除该订单吗?',
... ... @@ -136,18 +143,20 @@
request.get('/api/personal/delGoods', {
goods_id: id
}).then(res => {
this.dataList.splice(index, 1)
this.listData()
if (res.code == 1) {
that.dataList.splice(index, 1)
that.listData()
}
}).catch(err => {
})
this.listData()
} else if (res.cancel) {}
}
});
},
delNeed(id, index) {
let that = this
uni.showModal({
title: '提示',
content: '确认删除该订单吗?',
... ... @@ -156,7 +165,8 @@
request.get('/api/personal/delNeed', {
id: id
}).then(res => {
this.listData1()
that.dataList.splice(index, 1)
that.listData1()
}).catch(err => {
})
... ... @@ -173,12 +183,13 @@
<style>
@import url("/common/uni.css");
@import url("/common/issue.css");
.issueBox{
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
white-space: normal;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
.issueBox {
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
white-space: normal;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
}
</style>
... ...
... ... @@ -4,8 +4,9 @@
<view class="AllTop">
<view class="AllUser">
<view class="userTop">
<view class="userImg" @click="goUSER">
<image :src="userData.avatar" style="width: 120rpx;height: 120rpx;border-radius: 50%;" mode=""></image>
<view class="userImg" >
<image :src="userData.avatar" style="width: 120rpx;height: 120rpx;border-radius: 50%;" mode="" v-if="token" @click="goUSER"></image>
<image src="/static/image/nimingtouxiang.png" style="width: 120rpx;height: 120rpx;border-radius: 50%;" mode="" v-if="!token" @click="login"></image>
</view>
<view class="userNav">
<text class="userNavTex" v-if="!token" @click="login">请登录</text>
... ... @@ -113,6 +114,18 @@
<image src="../../../static/image/gengduo_icon_5@2x.png" style="width: 32rpx;height: 32rpx;" mode=""></image>
</view>
</view>
<view class="meBotontt" @click="userDeal">
<view class="meBotontPic">
<image src="../../../static/image/kefu_icon_1@2x.png" style="width: 32rpx;height: 32rpx;margin-right: 14rpx;"
mode=""></image>
</view>
<view class="meBotontText " >
<text class="meBotText">用户协议</text>
</view>
<view class="meBotontImg">
<image src="../../../static/image/gengduo_icon_5@2x.png" style="width: 32rpx;height: 32rpx;" mode=""></image>
</view>
</view>
<view class="meBotontt kefuBorder" @click="onKeFu">
<view class="meBotontPic">
<image src="../../../static/image/kefu_icon_1@2x.png" style="width: 32rpx;height: 32rpx;margin-right: 14rpx;"
... ... @@ -159,7 +172,6 @@
</view>
</li>
<li @click="goMessage" style="position: relative;">
<image src="../../../static/image/xiaoxi_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
<text class="botText">消息</text>
<view class="num" v-if="messageNum!==0">
... ... @@ -396,6 +408,12 @@
this.login()
}
},
//用户协议
userDeal(){
uni.navigateTo({
url:'/myPackage/pages/me/user-deal'
})
},
//客服
onKeFu() {
if (this.token) {
... ...
<template>
<view class="content">
<view class="title">
《科欧社区淘》
</view>
<rich-text :nodes="content"></rich-text>
</view>
</template>
<script>
import request from '../../../utils/request.js'
export default {
data() {
return {
content: ''
}
},
onShow() {
request.get('')
}
}
</script>
<style>
.content {
padding: 0 32rpx;
box-sizing: border-box;
min-height: 100vh;
background-color: #fff;
}
.title {
font-weight: 600;
font-size: 36rpx;
color: #000;
text-align: center;
padding: 32rpx 0;
box-sizing: border-box;
}
</style>
... ...
... ... @@ -9,20 +9,6 @@
}
}
},
// {
// "path": "pages/me/me",
// "style": {
// "navigationBarTitleText": "我的",
// "enablePullDownRefresh": false,
// "navigationBarBackgroundColor": "#FF9D66",
// "navigationBarTextStyle": "white",
// "usingComponents": {
// "van-popup": "/wxcomponents/vant/dist/popup/index"
// }
// }
// },
{
"path": "pages/activity/activity",
"style": {
... ... @@ -72,34 +58,14 @@
"navigationBarTitleText": "搜索",
"enablePullDownRefresh": false
}
},{
"path": "pages/index/public-page",
"style": {
"navigationBarTitleText": "科欧社区淘",
"enablePullDownRefresh": false
}
},
// {
// "path": "pages/me/issue",
// "style": {
// "navigationBarTitleText": "我的发布",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
// {
// "path": "pages/me/group",
// "style": {
// "navigationBarTitleText": "我的活动",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
// {
// "path": "pages/me/invite",
// "style": {
// "navigationBarTitleText": "邀请有礼",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
{
"path": "pages/index/classify",
"style": {
... ... @@ -122,95 +88,7 @@
}
}
},
// {
// "path": "pages/me/personal",
// "style": {
// "navigationBarTitleText": "我的资料",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
// {
// "path": "pages/me/collect",
// "style": {
// "navigationBarTitleText": "收藏",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
// {
// "path": "pages/me/attention",
// "style": {
// "navigationBarTitleText": "关注",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
// {
// "path": "pages/me/integral",
// "style": {
// "navigationBarTitleText": "积分记录",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
// {
// "path": "pages/me/fans",
// "style": {
// "navigationBarTitleText": "粉丝",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
// {
// "path": "pages/me/purchase",
// "style": {
// "navigationBarTitleText": "购买商品",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
// {
// "path": "pages/me/sell",
// "style": {
// "navigationBarTitleText": "售卖商品",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF"
// }
// },
// {
// "path": "pages/me/member",
// "style": {
// "navigationBarTitleText": "会员等级",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "black",
// "navigationBarBackgroundColor": "#FFFFFF",
// "usingComponents": {
// "van-progress": "/wxcomponents/vant/dist/progress/index"
// }
// }
// },
// {
// "path": "pages/me/orderItem",
// "style": {
// "navigationBarTitleText": "订单详情",
// "enablePullDownRefresh": false
// }
// },
// {
// "path": "pages/me/evaluate",
// "style": {
// "navigationBarTitleText": "发布评价",
// "enablePullDownRefresh": false
// }
// },
{
"path": "pages/index/classify-detail",
"style": {
... ... @@ -274,16 +152,6 @@
"navigationBarBackgroundColor": "#FFFFFF"
}
},
// {
// "path": "pages/me/completed",
// "style": {
// "navigationBarTitleText": "我的订单",
// "enablePullDownRefresh": false,
// "usingComponents": {
// }
// }
// },
{
"path": "pages/index/all-message",
"style": {
... ... @@ -330,20 +198,6 @@
}
}
},
// {
// "path": "pages/me/transaction",
// "style": {
// "navigationBarTitleText": "订单详情",
// "enablePullDownRefresh": false
// }
// },
// {
// "path": "pages/me/accomplish",
// "style": {
// "navigationBarTitleText": "订单详情",
// "enablePullDownRefresh": false
// }
// },
{
"path": "pages/activity/pintu-detail",
"style": {
... ... @@ -430,7 +284,7 @@
"van-popup": "/wxcomponents/vant/dist/popup/index"
}
}
},
},
{
"path": "pages/me/transaction",
"style": {
... ... @@ -444,7 +298,7 @@
"navigationBarTitleText": "聊天",
"enablePullDownRefresh": false
}
},{
}, {
"path": "pages/me/personal",
"style": {
"navigationBarTitleText": "我的资料",
... ... @@ -581,6 +435,26 @@
}
}
},
{
"path": "pages/me/user-deal",
"style": {
"navigationBarTitleText": "用户协议",
"enablePullDownRefresh": false,
"usingComponents": {
}
}
},
{
"path": "pages/me/exchang-order-detail",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"usingComponents": {
}
}
}
]
}],
... ...
... ... @@ -180,7 +180,7 @@
goDetail(ids) {
this.id = ids
uni.navigateTo({
url: "/pages/activity/pintu-detail?id=" + ids
url: "/pages/activity/pintu-detail?id=" + ids+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
},
//立即报名
... ...
<template>
<view class="" style="background-color: #f7f8fa; max-width: 100vh;padding-bottom: 166rpx;overflow: hidden;">
<view class="">
<view class="" style="height: 568rpx;">
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item v-for="(item,index) in swiperList" :key="index">
<image :src="item" mode="" class="swiper" style="height: 100%;width:100%"></image>
<image :src="item" mode="" class="swiper" style="height: 100%;width:100%" mode="aspectFill"></image>
<view class="swiperLength">
{{index+1}}/{{swiperList.length}}
</view>
... ... @@ -60,7 +60,6 @@
}
},
created() {
this.detail()
},
methods: {
//立即报名
... ... @@ -87,7 +86,22 @@
})
}
}
},
//分享
onShareAppMessage: function(e) {
let title = '最火社区闲置二手信息平台'
return {
title: title,
path: "/pages/activity/exchange-detail?id=" + this.id
}
},
onShareTimeline() {
return {
title: '最火社区闲置二手信息平台',
query: {},
imageUrl: '',
}
},
}
</script>
... ... @@ -96,6 +110,7 @@
max-width: 100vh;
overflow: hidden;
position: relative;
height: 100%;
}
.swiperLength {
... ...
<template>
<view class="" style="background-color: #f7f8fa; width: 100%;padding-bottom: 166rpx;">
<view class="">
<view class="" style="height: 568rpx;">
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration"
:circular="true">
<swiper-item v-for="(item,index) in swiperList" :key="index">
<image :src="item" mode="" class="swiper" style="height: 100%;"></image>
<image :src="item" mode="" class="swiper" style="height: 100%;" mode="aspectFill"></image>
<view class="swiperLength">
{{index+1}}/{{swiperList.length}}
</view>
... ... @@ -54,9 +54,18 @@
goodsData: {},
content: '',
lat:'',
lat1:'',
lot1:'',
lot:''
}
},
onLoad(options) {
if(options){
this.lat1=options.lat
this.lot1=options.lot
}
},
created() {
if (uni.getStorageSync('token')) {
this.token = true
... ... @@ -83,8 +92,8 @@
detail() {
request.get('/api/active/activeList', {
id: this.id,
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot')
lat2: uni.getStorageSync('lat')||this.lat1,
lng2: uni.getStorageSync('lot')||this.lot1
})
.then(res => {
this.swiperList = res.data.info[0].images;
... ... @@ -113,6 +122,21 @@
});
}
},
//分享
onShareAppMessage: function(e) {
let title = '最火社区闲置二手信息平台'
return {
title: title,
path: "/pages/activity/pintu-detail?id=" + this.id+'&lat='+this.lat+'&lot='+this.lot
}
},
onShareTimeline() {
return {
title: '最火社区闲置二手信息平台',
query: {},
imageUrl: '',
}
},
onLoad(option) {
this.id = option.id
this.detail()
... ... @@ -124,6 +148,7 @@
.swiper {
width: 100%;
position: relative;
height: 100%;
}
.swiperLength {
... ... @@ -184,6 +209,8 @@
.goodsPic {
width: 100%;
padding: 32rpx;
box-sizing: border-box;
}
.goodsPic image {
... ...
... ... @@ -18,24 +18,36 @@
已买
</view> -->
</view>
<scroll-view scroll-y="true" id="chatList" :scroll-top='scrollTop' @scrolltolower="lower()" :style="{height:scrollH+'rpx'}">
<scroll-view scroll-y="true" id="chatList" :scroll-top='scrollTop' @scrolltolower="lower()"
:style="{height:scrollH+'rpx'}">
<view :class="Number(index)==2?'margin1':'margin0'">
<view class="" v-if="index==1">
<view class="" v-for="(item,index) in list" :key="index" :class="item.type==1&&item.datetime?'leftItem1':item.type==1&&!item.datetime?'leftItem':item.type==0&&item.datetime?'rightItem1':item.type==0&&!item.datetime?'rightItem':''">
<view class="" v-for="(item,index) in list" :key="index"
:class="item.type==1&&item.datetime?'leftItem1':item.type==1&&!item.datetime?'leftItem':item.type==0&&item.datetime?'rightItem1':item.type==0&&!item.datetime?'rightItem':''">
<view class="dateTime" v-if="item.datetime!==undefined">
{{item.datetime}}
</view>
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'" v-if="item.type==1" @click="goUser(item.user_id)"></image>
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'" v-if="item.type==0" @click="goUser(item.user_id)"></image>
<view :class="item.type==1&&item.datetime?'leftContent1':item.type==1&&!item.datetime?'leftContent':item.type==0&&item.datetime?'rightContent1':'rightContent'"
style="position: relative;">
{{item.content}}
<view class="" style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;"
v-if="item.type==1">
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'"
v-if="item.type==1" @click="goUser(item.user_id)"></image>
<image :src="item.avatar1" mode="" :class="item.datetime?'headImg1':'headImg'"
v-if="item.type==0" @click="goUser(item.user_id)"></image>
<view
:class="item.type==1&&item.datetime?'leftContent1':item.type==1&&!item.datetime?'leftContent':item.type==0&&item.datetime?'rightContent1':'rightContent'"
style="position: relative;">
<view class="" v-if="!item.image">
{{item.content}}
</view>
<view class="" v-if="item.image">
<image :src="item.image" class="chatImage" @click="previewImg(item.image)"></image>
</view>
<view class=""
style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;z-index: -1;"
v-if="item.type==1">
</view>
<view class="" style="width: 20rpx;height: 20rpx;background-color: #FF834D;transform: rotate(45deg);position: absolute;top: 36rpx;right: -10rpx;"
v-if="item.type==0">
<view class=""
style="width: 20rpx;height: 20rpx;background-color: #FF834D;transform: rotate(45deg);position: absolute;top: 36rpx;right: -10rpx;z-index: -1;"
v-if="item.type==0">
</view>
</view>
... ... @@ -43,20 +55,30 @@
</view>
</view>
<view class="" v-if="index==2">
<view class="" v-for="(item,index) in list" :key="index" :class="item.type==0?'leftItem':'rightItem'">
<view class="" v-for="(item,index) in list" :key="index"
:class="item.type==0?'leftItem':'rightItem'">
<view class="dateTime" v-if="item.datetime!==undefined">
{{item.datetime}}
</view>
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==0" @click="goUser(item.user_id)"></image>
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==1" @click="goUser(item.user_id)"></image>
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==0"
@click="goUser(item.user_id)"></image>
<image :src="item.avatar1" mode="" class="headImg" v-if="item.type==1"
@click="goUser(item.user_id)"></image>
<view :class="item.type==0?'leftContent':'rightContent'" style="position: relative;">
{{item.content}}
<view class="" style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;"
v-if="item.type==0">
<view class="" v-if="!item.image">
{{item.content}}
</view>
<view class="" v-if="item.image">
<image :src="item.image" class="chatImage" @click="previewImg(item.image)"></image>
</view>
<view class=""
style="width: 20rpx;height: 20rpx;background-color: #fff;transform: rotate(45deg);position: absolute;top: 36rpx;left: -10rpx;z-index: -1;"
v-if="item.type==0">
</view>
<view class="" style="width: 20rpx;height: 20rpx;background-color: #FF834D;transform: rotate(45deg);position: absolute;top: 36rpx;right: -10rpx;"
v-if="item.type==1">
<view class=""
style="width: 20rpx;height: 20rpx;background-color: #FF834D;transform: rotate(45deg);position: absolute;top: 36rpx;right: -10rpx;z-index: -1;"
v-if="item.type==1">
</view>
</view>
... ... @@ -67,21 +89,19 @@
</scroll-view>
<view :class="!picList?'inputBox':'inputBox inputBoxHeight'">
<!-- <textarea type="text" value="inputText" v-model="inputText" @input="bindInput" placeholder="请输入最新消息" cursor-spacing="20" /> -->
<!-- <view class="addIcon" @click.stop="addPic" v-if="inputText==''">
+
</view> -->
<!-- <textarea type="text" placeholder="请输入最新消息" auto-height :value="inputText"
@input="bindInput" cursor-spacing="20" placeholder-class="plac" style="height: 34px;"></textarea> -->
<textarea style="max-height: 3em" placeholder="请输入最新消息" :value="inputText" @input="bindInput" cursor-spacing="10" />
<textarea style="max-height: 3em" placeholder="请输入最新消息" :value="inputText" @input="bindInput"
cursor-spacing="10" />
<view class="sendBtn" v-if="inputText!==''" @click="send">
发送
</view>
<view class="sendBtn1" v-if="inputText==''" style="margin-left: 20rpx;">
发送
</view>
<view class="addPic" @click="upimg">
+
</view>
</view>
<!-- <view class="addPics" v-if="picList">
<!-- <view class="addPics" v-if="picList">
<image src="../../static/image/tianjia_icon@2x.png" mode="" style="width: 100rpx;height: 100rpx;" @click.stop="uploadImg"></image>
</view> -->
</view>
... ... @@ -91,217 +111,253 @@
import request from '../../utils/request.js'
export default {
onLoad(options) {
this.index=options.index
this.user_id=options.id
if(options.index==1){
this.index = options.index
this.user_id = options.id
if (options.index == 1) {
this.sellList()
}else{
this.goodsId=options.id||options.goods_id
this.buyList() //买家进入消息列表
} else {
this.goodsId = options.id || options.goods_id
this.buyList() //买家进入消息列表
this.buyGoodDeatil()
}
},
onShow(){
onShow() {
//默认最底部
setTimeout(() =>{
this.scrollTop=9999
},1000)
setTimeout(() => {
this.scrollTop = 9999
}, 1000)
},
computed: {
scrollH: function() {
let sys = uni.getSystemInfoSync();
let winWidth = sys.windowWidth;
let winrate = 750 / winWidth;
let winHeight = parseInt(sys.windowHeight * winrate)
return winHeight
},
},
computed:{
scrollH:function(){
let sys = uni.getSystemInfoSync();
let winWidth = sys.windowWidth;
let winrate = 750/winWidth;
let winHeight =parseInt(sys.windowHeight*winrate)
return winHeight
},
},
data() {
return {
index:0, //判断跳转页面
user_id:'', //用户id
pageNum:1,
goodsId:'',
index: 0, //判断跳转页面
user_id: '', //用户id
pageNum: 1,
goodsId: '',
inputText: '',
picList:false, //添加图片
fileList:[],
picList: false, //添加图片
fileList: [],
list: [],
goodDatas:'',
yimaiBtn:true, //已买
scrollTop:0,
old: {scrollTop: 0}
imgs: [], //图片数组
goodDatas: '',
yimaiBtn: true, //已买
scrollTop: 0,
old: {
scrollTop: 0
}
}
},
onReachBottom() {
this.pageNum=this.pageNum+1
if(this.index==1){
this.pageNum = this.pageNum + 1
if (this.index == 1) {
this.sellList()
}else{
} else {
this.buyList()
}
},
methods: {
// scroll: function(e) {
// console.log(e)
// this.old.scrollTop = e.detail.scrollTop
// },
// scroll: function(e) {
// console.log(e)
// this.old.scrollTop = e.detail.scrollTop
// },
//用户主页
goUser(id){
goUser(id) {
uni.navigateTo({
url:'/pages/index/user-page?id='+id
url: '/pages/index/user-page?id=' + id
})
},
//已买
yimai(id){
let that=this
request.get('/api/personal/yiBuy',{
buy_id:id
}).then(res=>{
that.yimaiBtn=false
}).catch(err=>{
yimai(id) {
let that = this
request.get('/api/personal/yiBuy', {
buy_id: id
}).then(res => {
that.yimaiBtn = false
}).catch(err => {
})
},
//买商品进入聊天页面
buyList(){
let that=this
request.get('/api/goods/buyPage',{
page:that.pageNum,
rows:15,
goods_id:that.goodsId
}).then(res=>{
let list=this.pageNum==1?res.data.info:this.list.concat(res.data.info)
this.list=list
}).catch(err=>{
},
//买商品进入聊天页面
buyList() {
let that = this
request.get('/api/goods/buyPage', {
page: that.pageNum,
rows: 15,
goods_id: that.goodsId
}).then(res => {
let list = this.pageNum == 1 ? res.data.info : this.list.concat(res.data.info)
this.list = list
}).catch(err => {
})
},
//买商品进入聊天商品详情
buyGoodDeatil(){
let that=this
request.get('/api/goods/goodsChat',{
goods_id:that.goodsId
}).then(res=>{
this.goodDatas=res.data
}).catch(err=>{
},
//买商品进入聊天商品详情
buyGoodDeatil() {
let that = this
request.get('/api/goods/goodsChat', {
goods_id: that.goodsId
}).then(res => {
this.goodDatas = res.data
}).catch(err => {
})
},
//卖商品进入聊天页面
sellList(){
request.get('/api/mation/myChat',{
page:this.pageNum,
rows:15,
user_id:this.user_id
}).then(res=>{
let list=this.pageNum==1?res.data.info:this.list.concat(res.data.info)
this.list=list
}).catch(err=>{
},
//卖商品进入聊天页面
sellList() {
request.get('/api/mation/myChat', {
page: this.pageNum,
rows: 15,
user_id: this.user_id
}).then(res => {
let list = this.pageNum == 1 ? res.data.info : this.list.concat(res.data.info)
this.list = list
}).catch(err => {
})
},
//买家发消息
buySendContent(){
let that=this
request.get('/api/goods/buyChat',{
goods_id:this.goodsId,
content:that.inputText
}).then(res=>{
this.pageNum=1
},
//买家发消息
buySendContent() {
let that = this
request.get('/api/goods/buyChat', {
goods_id: this.goodsId,
content: that.inputText
}).then(res => {
this.pageNum = 1
this.buyList()
}).catch(err=>{
})
},
//卖家发消息
selSendContent(){
let that=this
request.get('/api/mation/replyChat',{
user_id:this.user_id,
content:that.inputText
}).then(res=>{
this.pageNum=1
this.sellList()
}).catch(err=>{
})
},
concelPIC(){
let that=this
that.picList=false
}).catch(err => {
})
},
//卖家发消息
selSendContent() {
let that = this
request.get('/api/mation/replyChat', {
user_id: this.user_id,
content: that.inputText
}).then(res => {
this.pageNum = 1
this.sellList()
}).catch(err => {
})
},
concelPIC() {
let that = this
that.picList = false
},
bindInput(e) {
this.inputText = e.detail.value
},
addPic(){
let that=this
that.picList=true
addPic() {
let that = this
that.picList = true
},
send(){
if(this.index==2){
send() {
if (this.index == 2) {
this.buySendContent()
this.inputText='',
this.picList=true,
setTimeout(() =>{
this.scrollTop=99999
},1000)
}else{
this.selSendContent()
this.inputText='',
this.picList=true,
setTimeout(() =>{
this.scrollTop=99999
},1000)
this.inputText = '',
this.picList = true,
setTimeout(() => {
this.scrollTop = 99999
}, 1000)
} else {
this.selSendContent()
this.inputText = '',
this.picList = true,
setTimeout(() => {
this.scrollTop = 99999
}, 1000)
}
},
uploadImg(){
let that =this
upimg() {
var that = this;
uni.chooseImage({
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths;
const uploadTask = uni.uploadFile({
url: 'http://muying.t.brotop.cn/api/common/upload',
filePath: tempFilePaths[0],
name: 'file',
formData: {
'user': 'test'
},
count: 6,
success: function(res) {
var data = {
'user': 'test'
}
var tempFilePaths = res.tempFilePaths
tempFilePaths.forEach((item, index) => {
wx.uploadFile({
url: 'https://ketao.shequtaoapp.com/api/common/upload',
filePath: tempFilePaths[index],
name: 'file',
formData: data,
header: {
'token': uni.getStorageSync('token') || ''
},
success: (uploadFileRes) => {
let uploadList =JSON.parse(uploadFileRes.data).data
success: function(uploadFileRes) {
let uploadList = JSON.parse(uploadFileRes.data).data
that.fileList.push(uploadList.url)
// that.urlImg.push(uploadList.save_path)
}
});
}
});
that.send()
}
})
})
}
})
},
//点击图片
previewImg() {
let changeAddessShow=uni.getStorageSync('changeAddessShow')
let that = this
let list = this.list
let imgs = []
list.forEach((item, index) => {
if (item.image !== undefined) {
imgs.push(item.image)
}
})
this.imgs = imgs
uni.previewImage({
urls: imgs,
loop: true,
longPressActions: {
itemList: [],
success: function(data) {},
fail: function(err) {}
}
});
setTimeout(()=>{
uni.setStorageSync('changeAddessShow',changeAddessShow)
},1000)
},
}
}
</script>
<style>
.plac{
padding-top: 20rpx !important;
line-height: 80rpx;
}
.plac {
padding-top: 20rpx !important;
line-height: 80rpx;
}
.content {
padding-top: 20rpx;
box-sizing: border-box;
min-height: 100vh;
}
.margin0{
.margin0 {
margin-top: 32rpx;
padding-bottom: 120rpx;
}
.margin1{
.margin1 {
margin-top: 200rpx;
padding-bottom: 120rpx;
}
.topcontent{
.topcontent {
position: fixed;
top: 0;
left: 0;
... ... @@ -314,49 +370,56 @@
justify-content: space-between;
align-items: center;
}
.leftBox{
display: flex;
}
.rightBox{
font-size: 28rpx;
border-radius: 48rpx;
width: 160rpx;
height: 68rpx;
text-align: center;
line-height: 68rpx;
color: #fff;
background: linear-gradient(135deg,#ff814a, #ff9d66);
}
.rightBox1{
font-size: 28rpx;
border-radius: 48rpx;
width: 160rpx;
height: 68rpx;
text-align: center;
line-height: 68rpx;
color: #fff;
background-color: #e5dfdd;
}
.leftBox {
display: flex;
}
.rightBox {
font-size: 28rpx;
border-radius: 48rpx;
width: 160rpx;
height: 68rpx;
text-align: center;
line-height: 68rpx;
color: #fff;
background: linear-gradient(135deg, #ff814a, #ff9d66);
}
.rightBox1 {
font-size: 28rpx;
border-radius: 48rpx;
width: 160rpx;
height: 68rpx;
text-align: center;
line-height: 68rpx;
color: #fff;
background-color: #e5dfdd;
}
.headImg {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
}
.headImg1 {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
margin-top: 72rpx;
}
.sendBtn{
padding: 6rpx 10rpx;
font-size: 24rpx;
background-color: #09BB07;
color: #fff;
border-radius: 10rpx;
margin-left: 20rpx;
}
.sendBtn {
padding: 6rpx 10rpx;
font-size: 24rpx;
background-color: #09BB07;
color: #fff;
border-radius: 10rpx;
margin-left: 20rpx;
}
/* 左边 */
.leftItem {
display: flex;
... ... @@ -365,7 +428,8 @@
margin-bottom: 40rpx;
position: relative;
}
.leftItem1 {
.leftItem1 {
display: flex;
padding: 0 24rpx;
box-sizing: border-box;
... ... @@ -373,6 +437,7 @@
position: relative;
margin-top: 70rpx;
}
.leftContent {
background-color: #fff;
padding: 26rpx 20rpx;
... ... @@ -381,7 +446,8 @@
max-width: 560rpx;
border-radius: 16rpx;
}
.leftContent1 {
.leftContent1 {
background-color: #fff;
padding: 26rpx 20rpx;
box-sizing: border-box;
... ... @@ -390,6 +456,7 @@
border-radius: 16rpx;
margin-top: 72rpx;
}
/* 右边 */
.rightItem {
display: flex;
... ... @@ -397,15 +464,16 @@
box-sizing: border-box;
margin-bottom: 40rpx;
flex-direction: row-reverse;
position:relative;
position: relative;
}
.rightItem1 {
display: flex;
padding: 0 24rpx;
box-sizing: border-box;
margin-bottom: 40rpx;
flex-direction: row-reverse;
position:relative;
position: relative;
margin-top: 70rpx;
}
... ... @@ -418,7 +486,8 @@
color: #fff;
border-radius: 16rpx;
}
.rightContent1 {
.rightContent1 {
background-color: #FF834D;
padding: 20rpx;
box-sizing: border-box;
... ... @@ -440,64 +509,77 @@
align-items: center;
justify-content: center;
}
.inputBoxHeight{
bottom: 200rpx;
}
.addPics{
padding: 50rpx;
position: fixed;
bottom: 0;
left: 0;
box-sizing: border-box;
display: block !important;
}
/* textarea{
min-height: 50rpx !important;
height: 70rpx !important;
max-height: 250rpx;
line-height: 70rpx;
border: 2rpx solid rgba(25, 24, 51, 0.06);
border-radius: 40rpx !important;
width: 80%;
background-color: #fff !important;
border-radius: 10rpx;
/* padding: 16rpx;
padding-left: 20rpx; */
/* line-height: 48rpx; */
/* padding-top: 10rpx; */
/* box-sizing: border-box; */
/* padding-top: 16rpx !important; */
/* padding-bottom: 20rpx !important; */
/* } */
textarea {
width: 600rpx;
padding-top: 20rpx;
.inputBoxHeight {
bottom: 0rpx;
}
.addPics {
padding: 50rpx;
position: fixed;
bottom: 0;
left: 0;
box-sizing: border-box;
display: block !important;
}
textarea {
width: 520rpx;
padding-top: 20rpx;
padding-left: 20rpx;
box-sizing: border-box;
border: 2rpx solid rgba(25, 24, 51, 0.06);
border-radius: 40rpx !important;
}
}
.addIcon {
font-size: 30rpx;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: 2rpx solid #cbcbcb;
color:#cbcbcb;
color: #cbcbcb;
text-align: center;
line-height: 40rpx;
margin-left: 20rpx;
}
.dateTime{
.dateTime {
position: absolute;
top:-44rpx;
top: -44rpx;
left: 50%;
opacity: 1;
background: #cccccc;
border-radius: 16px;
padding: 0 30rpx;
font-size: 20rpx;
color: #fff;
transform: translate(-50%, 0);
background: #cccccc;
border-radius: 16px;
padding: 0 30rpx;
font-size: 20rpx;
color: #fff;
transform: translate(-50%, 0);
}
.sendBtn1 {
padding: 1rpx 10rpx;
border: 2rpx solid #bababa;
border-radius: 8rpx;
box-sizing: border-box;
color: #bababa;
}
.addPic {
border: 2rpx solid #b3b3b3;
color: #b3b3b3;
border-radius: 50%;
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
margin-left: 20rpx;
}
.chatImage {
width: 240rpx;
height: 240rpx;
margin: -30rpx -20rpx -40rpx;
border-radius: 16rpx;
}
</style>
... ...
... ... @@ -72,7 +72,7 @@
this.indexs=options.index
this.id=options.id
this.classifList()
this.classifyChange('', '')
this.classifyChange('', 1)
},
data() {
return {
... ... @@ -140,7 +140,7 @@
},
goDetail(id){
uni.navigateTo({
url:'/pages/index/good-details?goos_id='+id
url:'/pages/index/good-details?goos_id='+id+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
}
}
... ...
... ... @@ -8,13 +8,13 @@
</view>
</scroll-view>
<scroll-view scroll-y class='listRight'>
<view class="rightList" >
<view class="rightList">
<view class="rightItem" v-for="(item,index) in rightList" :key='index' @click="detail(item.id,index)">
<image :src="item.image" mode="" class="img"></image>
<view class="">
<view class="" style="font-size: 30rpx;">
{{item.name}}
</view>
</view>
</view>
</scroll-view>
... ... @@ -23,60 +23,77 @@
<script>
import request from '../../utils/request.js'
export default {
onLoad:function(options){
this.fristClassify()
setTimeout(()=>{
if(options.index==4||options.id==null){
let id=this.leftList[0].id
this.id=id
this.secondClassify(id)
}else{
this.leftIndex=options.index
this.id=options.id
this.secondClassify(options.id)
}
},500)
onLoad(options) {
let that = this
that.fristClassify()
if (options.index == 4) {
that.leftIndex = 0
} else {
that.leftIndex = Number(options.index)
}
that.id = options.id
// setTimeout(()=>{
// if(options.index==4||options.id==null){
// if(that.leftList){
// console.log(that.leftList[0],'0000')
// let id=that.leftList[0].id
// that.id=id
// console.log(id,'iddd')
// // that.secondClassify(id)
// }
// }else{
// that.leftIndex=options.index
// that.id=options.id
// that.secondClassify(options.id)
// }
// },500)
},
data() {
return {
id:'', //一级分类id
id: '', //一级分类id
leftIndex: 0,
leftList: [],
rightList: []
}
},
created() {
},
methods: {
clickItem(id, index) {
console.log(id)
this.id=id
this.id = id
this.leftIndex = index;
this.secondClassify(id)
},
//一级分类
fristClassify(){
request.get('/api/index/inFen',{}).then(res=>{
this.leftList=res.data.info
}).catch(err=>{
fristClassify() {
request.get('/api/index/inFen', {}).then(res => {
this.leftList = res.data.info
if (this.leftIndex == 0 || this.leftIndex == 4) {
this.secondClassify(this.leftList[0].id)
} else {
this.secondClassify(this.leftList[this.leftIndex].id)
}
}).catch(err => {
})
},
//二级分类
secondClassify(ids){
request.get('/api/push/fenLei',{
id:ids
}).then(res=>{
this.rightList=res.data.info
}).catch(err=>{
secondClassify(ids) {
request.get('/api/push/fenLei', {
id: ids
}).then(res => {
this.rightList = res.data.info
}).catch(err => {
})
},
detail(id,index){
detail(id, index) {
uni.navigateTo({
url:"/pages/index/classify-detail?id="+id+'&index='+index+'&classifyId='+this.id
url: "/pages/index/classify-detail?id=" + id + '&index=' + index + '&classifyId=' + this.id
})
}
}
... ... @@ -112,34 +129,40 @@
}
.leftItem {
padding: 26rpx 36rpx;
font-size: 28rpx;
padding: 26rpx 28rpx;
font-size: 30rpx;
color: #969799;
}
.leftItem1 {
padding: 26rpx 32rpx;
font-size: 28rpx;
padding: 26rpx 28rpx;
font-size: 30rpx;
color: #323233;
background-color: #fff;
border-left:8rpx solid #ff834d;
border-left: 8rpx solid #ff834d;
box-sizing: border-box;
}
.rightList{
.rightList {
display: flex;
flex-wrap: wrap;
}
.rightItem{
width: 33.3%;
text-align: center;
/* padding: 14rpx 44rpx 20rpx; */
}
.img{
width:88rpx;
height:88rpx;
border-radius: 8rpx;
}
.rightItem {
width: 33.3%;
text-align: center;
white-space: nowrap;
overflow: hidden;
/* padding: 14rpx 44rpx 20rpx; */
}
.img {
width: 88rpx;
height: 88rpx;
border-radius: 8rpx;
}
.active {
background-color: #fff;
}
</style>
\ No newline at end of file
</style>
... ...
<template>
<view :class="shareBj||haibao?'minHeight':''" style="min-height: 100%;background-color: #F7F8FA;padding-top: 32rpx;box-sizing: border-box;">
<view :class="shareBj||haibao?'minHeight':''"
style="min-height: 100%;background-color: #F7F8FA;padding-top: 32rpx;box-sizing: border-box;">
<view class="goodDetailsBox" v-if="detailData.user.avatar">
<view class="detailsLeftBox" @click="goUserPage">
<image :src="detailData.user.avatar" mode="aspectFill"></image>
... ... @@ -13,12 +14,15 @@
</view>
</view>
<view class="userAddBoxs leftPublic">
【地址】
<view class="" style="font-weight: bolder;">【</view>地址<view class="" style="font-weight: bolder;">
</view>
<view class="rightPublic">
<text>{{detailData.address}}</text>
<text style="margin-left: 10rpx;">({{detailData.dis}} km)</text>
<view class="" style="display: flex;align-items: center;" @click="tomap">
<image src="../../static/image/Frame_11@2x.png" mode="" style="width:28rpx;height: 28rpx;margin-right: 6rpx;"></image>
<image src="../../static/image/Frame_11@2x.png" mode=""
style="width:28rpx;height: 28rpx;margin-right: 6rpx;"></image>
<text class="lookBtn">
查看地图</text>
</view>
... ... @@ -26,13 +30,18 @@
</view>
</view>
<view class="classifyBoxs leftPublic">
【类别】
<view class="" style="font-weight: bolder;">【</view>类别<view class="" style="font-weight: bolder;">
</view>
<view class="rightPublic">
{{classifyFirst}}
</view>
</view>
<view class="newOldBoxs leftPublic">
【新旧程度】
<view class="" style="font-weight: bolder;">【</view>新旧程度
<view class="" style="font-weight: bolder;">
</view>
<view class="rightPublic">
{{oldList[detailData.damage_id-1]}}
</view>
... ... @@ -47,8 +56,10 @@
{{detailData.content}}
</view>
<view class="goodPicList">
<view :class="index!==detailData.images.length-1?'styleMargin':''" v-for="(item,index) in detailData.images" :key="index">
<image :src="item" mode="" @click="previewImg" :class="detailData.images.length==1?'fristImage':''"></image>
<view :class="index!==detailData.images.length-1?'styleMargin':''"
v-for="(item,index) in detailData.images" :key="index">
<image :src="item" mode="" @click="previewImg"
:class="detailData.images.length==1?'fristImage':''"></image>
</view>
</view>
<view class="wantBox">
... ... @@ -60,7 +71,8 @@
<view class="messagesBox">
用户留言
<view class="userMessage">
<view class="messageItem" v-for="(item,index) in messageList" :key="index" v-if="index<=2" @click="mainMessage">
<view class="messageItem" v-for="(item,index) in messageList" :key="index" v-if="index<=2"
@click="mainMessage">
<view class="messageUser">
<view class="head">
<image :src="item.avatar" mode="" class="messageHead"></image>
... ... @@ -74,12 +86,16 @@
</view>
</view>
</view>
<view class="messageContent">
{{item.content}}
<view class="" style="margin-top: 34rpx;">
<!-- <view class="messageContent"> -->
<view class="">
<view class="messageContent">
{{item.content}}
</view>
<view class="" style="padding-left: 104rpx;box-sizing: border-box;">
<view class="allWrite" v-for="(list,index) in item.in" :key="index" v-if="index<2">
<text class="messageUser">
{{list.nickname1}}
{{list.nickname1}}:
</text>
<text v-if="list.status==1" class="messageUser">
[卖家]
... ... @@ -93,33 +109,42 @@
<text v-if="list.status==2" class="messageUser">
[卖家]
</text>
<text style="color:#969799;padding-right: 10rpx;margin-left: -6rpx;">:</text>
<!-- <text style="color:#969799;padding-right: 10rpx;margin-left: -6rpx;">:</text> -->
<text class="messageText">
{{list.content}}
</text>
</view>
<view class="" @click.stop="lookMessageMain(item.id)" v-if="item.in.length>2"
style="font-size: 24rpx;color: #0050f0;">
查看全部
</view>
</view>
<view class="moreReply" style="display: flex;align-items: center;padding-top:24rpx;" v-if="item.in.length>3"
@click="moreMessage(item.id)">
<image src="/static/image/chakangengduo_icon_1@2x.png" mode=""></image>
<tex </view> </view> <view class="messageMain" @click="mainMessage" v-if="messageList.length>3">
查看全部{{messageList.length}}条留言
<view class="">
<image src="/static/image/gengduo_icon_1@2x.png" mode="" class="lookMain"></image>
</view>
<view class="moreReply" style="display: flex;align-items: center;padding-top:24rpx;"
v-if="item.in.length>3" @click="moreMessage(item.id)">
<!-- <image src="/static/image/chakangengduo_icon_1@2x.png" mode=""></image> -->
<tex </view>
</view>
<view class="messageMain" @click="mainMessage" v-if="messageList.length>3&&index==2">
查看全部{{messageList.length}}条留言
<view class="">
<image src="/static/image/gengduo_icon_1@2x.png" mode="" class="lookMain"></image>
</view>
</view>
</view>
</view>
<view class="" style="margin-bottom: 100rpx;padding-bottom: 64rpx;">
<view class="" style="display: flex;justify-content: center;align-items: center;padding-top: 32rpx;">
<view class=""
style="display: flex;justify-content: center;align-items: center;padding-top: 32rpx;">
<view class="leftBorder" style="width:48rpx;border: 2rpx solid #ff834d;"></view>
<view class="" style="margin-left:48rpx;margin-right: 48rpx;">
相似商品
</view>
<view class="rightBorder" style="width:48rpx;border: 2rpx solid #ff834d;"></view>
</view>
<view class="goodsList" style="display: flex;justify-content: space-between;flex-wrap: wrap; width: 100%; ">
<view class="goodsBox" v-for="(item,index) in goodsList" :key="index" @click="goDetail(item.goods_id)" style="width: 48%;">
<view class="goodsList"
style="display: flex;justify-content: space-between;flex-wrap: wrap; width: 100%; ">
<view class="goodsBox" v-for="(item,index) in goodsList" :key="index"
@click="goDetail(item.goods_id)" style="width: 48%;">
<view class="goodsPic" style="width: 324rpx;" id="goodspic">
<image :src="item.images[0]" mode="" class="goodImg"></image>
</view>
... ... @@ -140,7 +165,8 @@
</view>
</view>
<view class="userRight" style="align-items: center;">
<image src="/static/image/zuanshi_icon_1@2x.png" mode="" style="width: 20rpx;height: 20rpx;"></image>
<image src="/static/image/zuanshi_icon_1@2x.png" mode=""
style="width: 20rpx;height: 20rpx;"></image>
<view class="" style="padding-bottom: 6rpx;margin-left: 6rpx;font-size: 18rpx;">
{{item.user.grade_status==0?'L0':item.user.grade_status==1?'L1':item.user.grade_status==2?'L2':item.user.grade_status==3?'L3':item.user.grade_status==4?'L4':'L5'}}
</view>
... ... @@ -200,23 +226,26 @@
</view>
</view>
<!-- 分享朋友圈图片 -->
<view class="haibaoBj" v-if="shareBj" @click="cancelSave">
<!-- <view class="haibaoBj" v-if="shareBj" @click="cancelSave">
<image src="../../static/image/fxiang.png" mode="" style="position: absolute;top: 0;left: 67%;width: 130rpx;height: 200rpx;"></image>
</view> -->
<view style=" position: fixed;top: 20rpx;left: 126rpx;width: 500rpx;text-align: center;background-color: #ff9d66;color:#fff;z-index: 9;border-radius: 4rpx;" v-if="cricleShare">
点击右上角[...]可以分享到朋友圈
<view style="border: 10rpx solid #ff9d66;position: fixed;top:0;right:144rpx;border-top-color: transparent;border-right-color:transparent;border-left-color: transparent;">
</view>
</view>
<view class="mask" v-if="cricleShare" @click="shareMoments"></view>
<view class="mask" v-if="haibao"></view>
<view class="haibaoBj" v-if="haibao">
<view class="">
<image :src="haibaoPic" class="haibaoImg" mode="widthFix" ></image>
<image :src="haibaoPic" class="haibaoImg" mode="widthFix"></image>
</view>
<!-- <view class="saveText" v-if="openSettingBtnHidden">
保存到手机
</view> -->
<view v-if="openSettingBtnHidden" class="purple_btn btn_box" @click="saveEwm" style="color: #fff;">
保存到相册
</view>
<button v-else class="purple_btn btn_box" hover-class="none" open-type="openSetting" @opensetting='handleSetting'>保存到相册</button>
<button v-else class="purple_btn btn_box" hover-class="none" open-type="openSetting"
@opensetting='handleSetting'>保存到相册</button>
<view class="DELiCON" @click="cancelSave">
X
</view>
... ... @@ -238,15 +267,37 @@
uniPopupDialog
},
onLoad(options) {
console.log(options, 'options')
this.id = options.id
this.goods_id = options.goos_id
if (options.id === "undefined" || !options.id) {
this.goodsDetail()
if (options.lat) {
this.lat = options.lat
this.lot = options.lot
this.goodsDetail()
} else {
this.lat = uni.getStorageSync('lat')
this.lot = uni.getStorageSync('lot')
this.goodsDetail()
}
} else {
this.needsDetail()
if (options.lat) {
this.lat = options.lat
this.lot = options.lot
this.needsDetail()
} else {
this.lat = uni.getStorageSync('lat')
this.lot = uni.getStorageSync('lot')
this.needsDetail()
}
}
},
},
onShow() {
this.messageLists()
},
data() {
return {
token: false,
... ... @@ -272,6 +323,7 @@
openSettingBtnHidden: true, //是否授权保存图片
ewmImg: "", //这是要保存的图片
shareBj: false, //分享朋友圈
cricleShare:false
}
},
created() {
... ... @@ -285,16 +337,23 @@
let title = '最火社区闲置二手信息平台'
return {
title: title,
path: '/pages/index/good-details?userId=' + uni.getStorageSync('userInfo').id + '&goos_id=' + that.goods_id +
path: '/pages/index/good-details?userId=' + uni.getStorageSync('userInfo').id + '&goos_id=' + that
.goods_id +
'&id=' + that.id
}
},
onShareTimeline() {
let that = this
var query = {
goos_id: this.goods_id,
lat: this.lat2,
lot: this.lng2
};
query = JSON.stringify(query.data);
return {
title: '最火社区闲置二手信息平台',
query: 'goods_id=' + that.goos_id + '&id=' + that.id,
imageUrl: 'http://123.png',
query: query,
imageUrl: '',
}
},
methods: {
... ... @@ -306,6 +365,9 @@
open() {
this.$refs.popup.open()
},
shareMoments(){
this.cricleShare=false
},
closes(index) {
if (index == 1) {
this.haibao = true
... ... @@ -323,6 +385,7 @@
},
Sharecloses() {
this.shareBj = true
this.cricleShare=true
this.$refs.popup.close()
},
//海报
... ... @@ -438,8 +501,8 @@
//发布商品详情
goodsDetail() {
request.get('/api/goods/maiDetail', {
lat2: uni.getStorageSync('lat') ? uni.getStorageSync('lat') : '',
lng2: uni.getStorageSync('lot') ? uni.getStorageSync('lot') : '',
lat2: uni.getStorageSync('lat') ? uni.getStorageSync('lat') : this.lat,
lng2: uni.getStorageSync('lot') ? uni.getStorageSync('lot') : this.lot,
goods_id: this.goods_id
}).then(res => {
this.detailData = res.data
... ... @@ -463,8 +526,8 @@
needsDetail() {
let that = this
request.get('/api/goods/needDetail', {
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot'),
lat2: uni.getStorageSync('lat') ? uni.getStorageSync('lat') : this.lat,
lng2: uni.getStorageSync('lot') ? uni.getStorageSync('lot') : this.lot,
id: that.id
}).then(res => {
that.detailData = res.data
... ... @@ -476,10 +539,6 @@
that.degree()
that.messageLists()
that.sameGoods()
uni.pageScrollTo({
scrollTop: 0
})
... ... @@ -581,7 +640,7 @@
},
messageLists() {
request.get('/api/goods/goodsMsg', {
request.get('/api/msg/allMsg', {
goods_id: this.id || this.goods_id
}).then(res => {
this.messageList = res.data.info
... ... @@ -589,14 +648,20 @@
})
},
//查看单条留言
lookMessageMain(id) {
uni.navigateTo({
url: '/pages/index/more-message?id=' + id
})
},
//相似商品
sameGoods() {
request.get('/api/goods/likeGoods', {
page: '1',
rows: 10,
goods_id: this.goods_id ? this.goods_id : this.id,
lat2: uni.getStorageSync('lat'),
lng2: uni.getStorageSync('lot'),
lat2: uni.getStorageSync('lat') || this.lat,
lng2: uni.getStorageSync('lot') || this.lot,
}).then(res => {
console.log(res.data.info.data, 'datata')
this.goodsList = res.data.info.data
... ... @@ -738,6 +803,7 @@
font-weight: 600;
display: flex;
align-items: center;
padding-left: 10rpx;
}
.dengjiBox {
... ... @@ -769,9 +835,9 @@
}
.leftPublic {
font-size: 28rpx;
font-weight: 600;
color: #323233;
font-size: 30rpx;
font-weight: 500;
color: #000;
border-bottom: 2rpx solid #f2f3f5;
padding: 16rpx 0;
box-sizing: border-box;
... ... @@ -780,9 +846,9 @@
}
.rightPublic {
font-size: 28rpx;
font-size: 30rpx;
text-align: LEFT;
color: #646566;
color: #000;
font-weight: 500;
max-width: 360rpx;
overflow: hidden;
... ... @@ -795,6 +861,7 @@
color: #323233;
font-weight: 600;
padding-bottom: 16rpx;
padding-left: 10rpx;
}
.goodDetailPrice {
... ... @@ -803,20 +870,23 @@
text-align: LEFT;
color: #ee0a24;
padding-bottom: 16rpx;
padding-left: 10rpx;
}
.goodDetailDesc {
font-size: 28rpx;
font-size: 30rpx;
font-weight: 400;
text-align: LEFT;
color: #646566;
color: #000;
line-height: 44rpx;
padding-left: 10rpx;
}
.goodPicList {
display: flex;
flex-wrap: wrap;
padding-top: 16rpx;
padding-left: 10rpx;
}
.goodPicList image {
... ... @@ -875,8 +945,13 @@
font-weight: 400;
text-align: LEFT;
color: #323233;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
#goodspic{
#goodspic {
width: 324rpx !important;
}
</style>
... ...
<template>
<view class="container">
<image :src="IndexImg" style="width: 100%;" mode=""></image>
<view class="" style="position: fixed;top: 0;left: 0;height:176rpx;width: 100%;z-index: 99999;overflow: hidden;">
<view class=""
style="position: fixed;top: 0;left: 0;height:176rpx;width: 100%;z-index: 99999;overflow: hidden;">
<image :src="IndexImg" mode="" style="width: 100%;"></image>
<view class="" style="font-size:34rpx;color: #fff;position: absolute;top: 108rpx;left: 36rpx;" @click="goSelectAddress">
<view class="" style="font-size:34rpx;color: #fff;position: absolute;top: 108rpx;left: 36rpx;"
@click="goSelectAddress">
{{addressText}}
<!-- <image src="/static/image/Frame_11@2x.png" mode="" style="width: 24rpx;height: 24rpx;"></image> -->
<view class="arrowWhite">
... ... @@ -24,7 +26,8 @@
</view>
<view class="inputCon">
<image src="../../static/image/search.png" mode=""></image>
<input class="uni-input" placeholder="搜索" @focus='focus' v-model="inputValue" @input="bindInput" />
<input class="uni-input" placeholder="搜索" @focus='focus' v-model="inputValue"
@input="bindInput" />
</view>
<view class="mapBox" @click="cangbao">
<view class="picBox">
... ... @@ -37,23 +40,25 @@
</view>
</view>
<view class="swiperBox">
<swiper class="swiper" :indicator-dots="indicatorDots" :duration="duration" :circular="true" autoplay="true">
<swiper class="swiper" :indicator-dots="indicatorDots" :duration="duration" :circular="true"
autoplay="true">
<swiper-item v-for="(item,index) in swiperList" :key="index" @click="goGood(item.id_status)">
<image :src="item.image" mode="" class="swiper"></image>
</swiper-item>
</swiper>
</view>
<view class="classifyBox">
<view class="classifyPic" v-for="(item,index) in ClassifyList1" :key="index" @click="goClass(index,item.id)" v-if="index<3">
<view class="classifyPic" v-for="(item,index) in ClassifyList1" :key="index"
@click="goClass(index,item.id)" v-if="index<3">
<image :src="item.image" mode=""></image>
<text class="classifyText">{{item.name}}</text>
</view>
<view class="classifyPic" @click="goClass(4,'')">
<view class="classifyPic" @click="goClass(4,'')" v-if="ClassifyList1.length>0">
<image src="../../static/image/fenlei_icon_1@2x.png" mode=""></image>
<text class="classifyText">分类</text>
</view>
</view>
<view style="margin: 0 30rpx 0 34rpx;" v-if="listTypecont.length>0">
<view style="margin: 0 30rpx 0 34rpx;" v-if="listTypecont.length>0&&activeShow">
<view class="pintuanBox">
<view class="pintuanTop">
<view class="topLeft" style="display: flex;align-items: center;">
... ... @@ -75,7 +80,8 @@
</view>
<view class="pintuanBottom">
<scroll-view class="scrool-more" scroll-x="true" scroll-with-animation="true">
<view class="scrollItem" v-for="(item,index) in listTypecont" :key="index" v-if="index<=4" @click="goDetail(item.id)">
<view class="scrollItem" v-for="(item,index) in listTypecont" :key="index" v-if="index<=4"
@click="goDetail(item.id)">
<image :src="item.img" mode="" class="scrollPic" mode="scaleToFill"></image>
<text class="label-name">{{item.title }}</text>
</view>
... ... @@ -90,7 +96,8 @@
<view class="tabBox" style="margin: 0 30rpx;padding-bottom: 100rpx;">
<view class="inv-h-w">
<block v-for="(item,index) in tabList" :key="index">
<view :class="['inv-h',tabIndex== index?'inv-h-se':'']" @click="changeTab(index)">{{item}}</view>
<view :class="['inv-h',tabIndex== index?'inv-h-se':'']" @click="changeTab(index)">{{item}}
</view>
</block>
</view>
<view class="locationBtn" v-if="noAddress" @click="startLocations">
... ... @@ -106,14 +113,16 @@
<picker @change="bindPickerChange" :value="index" :range="array" class="picker">
<view class="uni-input pickerIner">{{array[index]}}</view>
<view class="image" style="position: absolute;top: 0;left: 150rpx;">
<image src="/static/image/fenlei_icon_3@2x.png" mode="" style="width: 28rpx;height: 28rpx;"></image>
<image src="/static/image/fenlei_icon_3@2x.png" mode=""
style="width: 28rpx;height: 28rpx;"></image>
</view>
</picker>
<view class="picker">
</view>
<view class="image">
<image src="/static/image/fenlei_icon_3@2x.png" mode="" style="width: 28rpx;height: 28rpx;"></image>
<image src="/static/image/fenlei_icon_3@2x.png" mode=""
style="width: 28rpx;height: 28rpx;"></image>
</view>
</view>
</view>
... ... @@ -125,24 +134,29 @@
<picker @change="bindPickerChange1" :value="index1" :range="classArray" class="picker">
<view class="uni-input pickerIner">{{classArray[index1]}}</view>
<view class="image" style="position: absolute;top: 0;left: 146rpx;">
<image src="/static/image/fenlei_icon_3@2x.png" mode="" style="width: 28rpx;height: 28rpx;"></image>
<image src="/static/image/fenlei_icon_3@2x.png" mode=""
style="width: 28rpx;height: 28rpx;"></image>
</view>
</picker>
<view class="">
</view>
<view class="image">
<image src="/static/image/fenlei_icon_3@2x.png" mode="" style="width: 28rpx;height: 28rpx;"></image>
<image src="/static/image/fenlei_icon_3@2x.png" mode=""
style="width: 28rpx;height: 28rpx;"></image>
</view>
</view>
</view>
</view>
<view class="" v-if="tabIndex==0&&goodsList.length==0" style="padding: 50rpx;text-align: center;color: #969799;">
<view class="" v-if="tabIndex==0&&goodsList.length==0"
style="padding: 50rpx;text-align: center;color: #969799;">
暂无符合要求的商品
</view>
<view class="" v-if="tabIndex == 0" style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 44rpx;">
<view class="goodsBox" v-for="(item,index) in goodsList" :key="index" style="width: 330rpx; background: #fff; margin-bottom: 24rpx;padding-bottom: 18rpx;position: relative;border-radius: 16rpx 16rpx 0 0;"
@click="goGoodDetailXz(item.goods_id)">
<view class="" v-if="tabIndex == 0"
style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 44rpx;">
<view class="goodsBox" v-for="(item,index) in goodsList" :key="index"
style="width: 330rpx; background: #fff; margin-bottom: 24rpx;padding-bottom: 18rpx;position: relative;border-radius: 16rpx 16rpx 0 0;"
@click="goGoodDetailXz(item.goods_id)">
<view class="goodsPic">
<image :src="item.images[0]" class="goodImg" mode="aspectFill"></image>
</view>
... ... @@ -163,7 +177,8 @@
</view>
</view>
<view class="userRight" style="display: flex;align-items: center;">
<image src="/static/image/zuanshi_icon_1@2x.png" mode="" style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
<image src="/static/image/zuanshi_icon_1@2x.png" mode=""
style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
<view class="" style="font-size:18rpx;color: #fff;padding-bottom: 6rpx;">
{{item.user.grade_status==0?'L0':item.user.grade_status==1?'L1':item.user.grade_status==2?'L2':item.user.grade_status==3?'L3':item.user.grade_status==4?'L4':'L5'}}
</view>
... ... @@ -172,7 +187,8 @@
</view>
<view class="addressMask">
<image src="/static/image/dingwei_icon_1@2x.png" mode=""></image>
<view class="maskAddress" style="max-width: 192rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<view class="maskAddress"
style="max-width: 192rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{item.address}}
</view>
<view class="maskAddress">
... ... @@ -181,12 +197,15 @@
</view>
</view>
</view>
<view class="" v-if="tabIndex==1&&goodsList1.length==0" style="padding: 50rpx;text-align: center;color: #969799;">
<view class="" v-if="tabIndex==1&&goodsList1.length==0"
style="padding: 50rpx;text-align: center;color: #969799;">
暂无符合要求的商品
</view>
<view class="" v-if="tabIndex == 1" style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 44rpx;">
<view class="goodsBox" v-for="(item,index) in goodsList1" :key="index" style="width: 330rpx; background: #fff; margin-bottom: 24rpx;padding-bottom: 18rpx;position: relative;border-radius: 16rpx 16rpx 0 0;"
@click="goGoodDetailFx(item.id)">
<view class="" v-if="tabIndex == 1"
style="display: flex; justify-content: space-between;flex-wrap: wrap;margin-top: 44rpx;">
<view class="goodsBox" v-for="(item,index) in goodsList1" :key="index"
style="width: 330rpx; background: #fff; margin-bottom: 24rpx;padding-bottom: 18rpx;position: relative;border-radius: 16rpx 16rpx 0 0;"
@click="goGoodDetailFx(item.id)">
<view class="goodsPic">
<image :src="item.images[0]" mode="" class="goodImg" mode="aspectFit"></image>
</view>
... ... @@ -208,7 +227,8 @@
</view>
<view class="userRight" style="display: flex;align-items: center;">
<image src="/static/image/zuanshi_icon_1@2x.png" mode="" style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
<image src="/static/image/zuanshi_icon_1@2x.png" mode=""
style="width:20rpx;height: 17rpx;margin-right: 12rpx;"></image>
<view class="" style="font-size:18rpx;color: #fff;padding-bottom: 6rpx;">
{{item.user.grade_status==0?'L0':item.user.grade_status==1?'L1':item.grade_status==2?'L2':item.grade_status==3?'L3':item.grade_status==4?'L4':'L5'}}
</view>
... ... @@ -217,7 +237,8 @@
</view>
<view class="addressMask">
<image src="/static/image/dingwei_icon_1@2x.png" mode=""></image>
<view class="maskAddress" style="max-width: 192rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<view class="maskAddress"
style="max-width: 192rpx;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
{{item.address}}
</view>
<view class="maskAddress">
... ... @@ -231,14 +252,17 @@
</view>
</view>
<view class="meFa">
<van-popup :show="show" position="bottom" custom-style="height: 322rpx;border-top-left-radius: 50rpx;border-top-right-radius: 50rpx;"
@close="onClose">
<van-popup :show="show" position="bottom"
custom-style="height: 322rpx;border-top-left-radius: 50rpx;border-top-right-radius: 50rpx;"
@close="onClose">
<view class="meFaShow">
<view class="OnBuyProject" @click="OnBuyProject">
<image src="../../static/image/maixianzhi_icon@2x.png" style="width: 180rpx;height: 180rpx;" mode=""></image>
<image src="../../static/image/maixianzhi_icon@2x.png" style="width: 180rpx;height: 180rpx;"
mode=""></image>
</view>
<view class="OnMaiProject" @click="OnMaiProject">
<image src="../../static/image/faxuqiu_icon_1@2x.png" style="width: 180rpx;height: 180rpx;" mode=""></image>
<image src="../../static/image/faxuqiu_icon_1@2x.png" style="width: 180rpx;height: 180rpx;"
mode=""></image>
</view>
</view>
<view class="onFaClose" @click="onClose">
... ... @@ -248,21 +272,25 @@
</view>
<ul class="bottom">
<li @click="goIndex">
<image src="../../static/image/xianzhi_icon_1@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
<image src="../../static/image/xianzhi_icon_1@2x.png" style="width: 48rpx;height: 44rpx;" mode="">
</image>
<text class="botTextXZ">闲置</text>
</li>
<li @click="goActuvity">
<image src="../../static/image/huodong_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
<image src="../../static/image/huodong_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode="">
</image>
<text class="botText">活动</text>
</li>
<li @click="goFa">
<view class="fabu">
<image src="../../static/image/fabu_icon_1@2x.png" style="width: 88rpx;height: 88rpx;" mode=""></image>
<image src="../../static/image/fabu_icon_1@2x.png" style="width: 88rpx;height: 88rpx;" mode="">
</image>
<text class="botTextFa">发布</text>
</view>
</li>
<li @click="goMessage" style="position: relative;">
<image src="../../static/image/xiaoxi_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode=""></image>
<image src="../../static/image/xiaoxi_icon_5@2x.png" style="width: 48rpx;height: 44rpx;" mode="">
</image>
<text class="botText">消息</text>
<view class="num" v-if="messageNum!==0">
{{messageNum>99?'99+':messageNum}}
... ... @@ -286,20 +314,114 @@
uni.setStorageSync('pid', options.userId)
if (options.address) {
this.addressText = options.address
uni.setStorageSync('aaa', 11)
uni.setStorageSync('City', options.address)
uni.setStorageSync('lat', options.lat)
uni.setStorageSync('lot', options.lot)
} else {
}
} else {}
if (uni.getStorageSync('token')) {
this.token = true
}
},
onShow: function() {
if (uni.getStorageSync('changeAddessShow') == undefined) {
uni.setStorageSync('changeAddessShow', true)
}
if (uni.getStorageSync('changeAddessShow')) {
wx.getSetting({
success: (res) => {
if (res.authSetting['scope.userLocation']) {
let that = this
uni.getLocation({
type: 'wgs84',
altitude: true,
success(r) {
that.nowlocationLat=r.latitude
that.nowlocationLot=r.longitude
// wx.setStorageSync('nowLat', r.latitude)
// wx.setStorageSync('nowLot', r.longitude)
uni.request({
url: 'https://apis.map.qq.com/ws/geocoder/v1',
data: {
key: 'Y4PBZ-MBQ3Q-XSV5A-GWLXE-HXV4E-JNB3P',
location: (r.latitude + "," + r.longitude)
},
success: res => {
wx.setStorageSync('nowlocationCity', res.data.result.address_component
.city)
that.nowlocationAddress= res.data
.result.address_component
.district + res.data.result
.address_component
.street
// wx.setStorageSync('nowAddres', res.data
// .result.address_component
// .district + res.data.result
// .address_component
// .street)
wx.setStorageSync('nowAddres', res.data
.result.address_component
.district + res.data.result
.address_component
.street)
if (uni.getStorageSync("City") == "") {
that.addressText = res.data.result
.address_component.city
} else {
that.addressText = uni.getStorageSync(
"City")
}
}
})
},
fail(err) {}
})
if (uni.getStorageSync('selectCity')) {
if (uni.getStorageSync('nowlocationCity').substring(0, 2) !== uni
.getStorageSync('selectCity').substring(0,
2)) {
wx.showModal({
title: '切换城市',
content: '是否切换到当前位置',
confirmColor: '#f16765',
success: res => {
if (res.confirm) {
uni.setStorageSync('lat', that.nowlocationLat)
uni.setStorageSync('lot', that.nowlocationLot)
uni.setStorageSync('nowAddres', that.nowlocationAddress)
// this.getLocations()
}
uni.setStorageSync('changeAddessShow', false)
}
})
}
} else {
if (uni.getStorageSync('nowlocationCity').substring(0, 2) !== uni
.getStorageSync('locationCity').substring(0,
2)) {
wx.showModal({
title: '切换城市',
content: '是否切换到当前位置',
confirmColor: '#f16765',
success: res => {
if (res.confirm) {
uni.setStorageSync('lat', that.nowlocationLat)
uni.setStorageSync('lot', that.nowlocationLot)
uni.setStorageSync('nowAddres',that.nowlocationAddress)
// this.getLocations()
}
uni.setStorageSync('changeAddessShow', false)
}
})
}
}
}
}
})
}
let that = this
if (uni.getStorageSync("City") == "") {
this.getLocations();
... ... @@ -314,12 +436,15 @@
this.jvliSelect(); //距离选择
this.classifylistss(); //分类选择
this.goodsXy(); //发现需要
this.messageNums() //留言个数
}, 500)
},
data() {
return {
nowlocationLat:'', //每次进入维度
nowlocationLot:'', //每次进入经度
nowlocationAddress:'', //每次进入详细位置
firstTime: 0, //判断第几次进入该页面
token: false,
pageNums: 1,
pageNum: 1,
... ... @@ -337,7 +462,8 @@
IndexImg: 'https://s3.ax1x.com/2021/01/11/s8PyTK.png',
address: '', //定位
inputValue: '',
//拼团
//积分活动
activeShow:true, //积分活动是否显示
listTypecont: [],
scrollTop: 0,
tabList: ['闲置物品', '发现需要'],
... ... @@ -401,27 +527,32 @@
success(r) {
uni.setStorageSync('lat', r.latitude)
uni.setStorageSync('lot', r.longitude)
wx.setStorageSync('nowLat', r.latitude)
wx.setStorageSync('nowLot', r.longitude)
// wx.setStorageSync('nowLat', r.latitude)
// wx.setStorageSync('nowLot', r.longitude)
uni.request({
url: 'https://apis.map.qq.com/ws/geocoder/v1',
data: {
// key: '6XOBZ-DMOEI-3DOGU-5LVWI-RDNWS-HHBUU',
key: 'Y4PBZ-MBQ3Q-XSV5A-GWLXE-HXV4E-JNB3P',
location: (r.latitude + "," + r.longitude)
},
success: res => {
wx.setStorageSync('City', res.data.result.address_component.district + res.data.result.address_component.street)
wx.setStorageSync('nowAddres', res.data.result.address_component.district + res.data.result.address_component
wx.setStorageSync('locationCity', res.data.result.address_component
.city)
wx.setStorageSync('nowlocationCity',res.data.result.address_component
.city)
wx.setStorageSync('City', res.data.result.address_component.district +
res.data.result.address_component.street)
wx.setStorageSync('nowAddres', res.data.result.address_component
.district + res.data.result.address_component
.street)
if (that.addressText == '') {
if (uni.getStorageSync("City") == "") {
that.addressText = res.data.result.address_component.city
} else {
that.addressText = uni.getStorageSync("City")
}
// if (that.addressText == '') {
if (uni.getStorageSync("City") == "") {
that.addressText = res.data.result.address_component.city
} else {
that.addressText = uni.getStorageSync("City")
}
// }
}
})
},
... ... @@ -449,7 +580,8 @@
if (res.confirm) {
wx.openSetting({
success: data => {
if (data.authSetting["scope.userLocation"]) {
if (data.authSetting[
"scope.userLocation"]) {
this.getLocations()
}
}
... ... @@ -488,7 +620,8 @@
if (res.confirm) {
wx.openSetting({
success: data => {
if (data.authSetting["scope.userLocation"]) {
if (data.authSetting[
"scope.userLocation"]) {
this.getLocations()
}
}
... ... @@ -561,11 +694,12 @@
list.forEach((item, index) => {
this.classArray.push(item.name)
})
this.classArray.unshift('全部')
// this.ClassifyList.unshift({
// id: '',
// name: '全部'
// })
let lists = this.classArray
lists.forEach((item, index) => {
if (index == 0 && item !== '全部') {
this.classArray.unshift('全部')
}
})
}).catch(ex => {
});
... ... @@ -580,6 +714,17 @@
this.arrayList.push(item)
this.goodsXz(); //闲置物品
})
let lists = this.arrayList
lists.forEach((item, index) => {
if (index == 0 && item.long !== '全部') {
this.arrayList.unshift({
id: '',
long: '全部'
})
this.array.unshift('全部')
}
})
}).catch(ex => {
});
... ... @@ -599,8 +744,8 @@
name: '全部'
})
let list = this.ClassifyList
list.forEach((item,index)=>{
if(item.name!=='全部'){
list.forEach((item, index) => {
if (item.name !== '全部') {
this.ClassifyList1.push(item)
}
})
... ... @@ -613,13 +758,15 @@
//闲置商品
goGoodDetailXz(ids) {
uni.navigateTo({
url: "/pages/index/good-details?goos_id=" + ids + '&index=1'
url: "/pages/index/good-details?goos_id=" + ids + '&index=1' + '&lat=' + uni.getStorageSync(
'lat') + '&lot=' + uni.getStorageSync('lot')
})
},
//发现需要
goGoodDetailFx(ids) {
uni.navigateTo({
url: "/pages/index/good-details?id=" + ids + '&index=2'
url: "/pages/index/good-details?id=" + ids + '&index=2' + '&lat=' + uni.getStorageSync('lat') +
'&lot=' + uni.getStorageSync('lot')
})
},
//全部分类
... ... @@ -755,16 +902,6 @@
onClose() {
this.show = false
},
// getAuthorizeInfo(a = "scope.userLocation") {
// var _this = this;
// uni.authorize({
// scope: a,
// success() {
// _this.getocations() //定位;
// },
// fail() {}
// })
// }
//留言个数
messageNums() {
request.get('/api/mation/unreadNumber', {}).then(res => {
... ... @@ -772,7 +909,22 @@
}).catch(err => {
})
}
},
//分享
onShareAppMessage: function(e) {
let title = '最火社区闲置二手信息平台'
return {
title: title,
path: ''
}
},
onShareTimeline() {
return {
title: '最火社区闲置二手信息平台',
query: {},
imageUrl: '',
}
},
}
}
</script>
... ...
<template>
<view class="Login">
<button class="sys_btn" open-type="getUserInfo" lang="zh_CN" @getuserinfo="appLoginWx">小程序登录授权</button>
<view class="" style="padding-top:216rpx;box-sizing: border-box;text-align: center;">
<image src="/static/image/logo.png" mode="" style="width: 160rpx;height: 160rpx;"></image>
<view class="title">
社区淘
</view>
<view class="desc">
来到社区淘,闲置就近卖
</view>
</view>
<view class="btn" v-if="checked">
登录
<button class="sys_btn" open-type="getUserInfo" lang="zh_CN" @getuserinfo="appLoginWx"></button>
</view>
<view class="btn1" v-if="!checked" @click="login">
登录
</view>
<view class="uni-padding-wrap">
<view style="text-align: center;font-size: 24rpx;">
<label class="radio" @change="radioChange"
style="display: flex;align-items: center;justify-content: center;">
<radio value="r1" :checked="checked" @click="radioChange" color="#FF834D" />
<text @click="radioText">我已阅读并同意</text><text style="color:#FF834D;" @click.stop="goUserDeal">《用户服务协议》</text>
</label>
</view>
</view>
</view>
</template>
... ... @@ -9,11 +34,29 @@
export default {
data() {
return {
checked: false
}
},
methods: {
radioChange(e) {
this.checked = !this.checked
},
radioText(){
this.checked = !this.checked
},
//用户协议
goUserDeal() {
uni.navigateTo({
url: '/myPackage/pages/me/user-deal'
})
},
login() {
uni.showToast({
title: '请选择用户协议',
icon: "none"
})
},
appLoginWx() {
uni.getProvider({
service: 'oauth',
... ... @@ -27,15 +70,22 @@
uni.getUserInfo({
provider: 'weixin',
success: function(infoRes) {
uni.setStorageSync('userInfo', infoRes.userInfo)
uni.setStorageSync('userInfo', infoRes
.userInfo)
request.post('/api/common/login', {
code: loginRes.code,
rawData: JSON.stringify(uni.getStorageSync('userInfo')),
pid:uni.getStorageSync('pid')
rawData: JSON.stringify(uni
.getStorageSync(
'userInfo')),
pid: uni.getStorageSync('pid')
}).then(res => {
if (res.code == 1) {
uni.setStorageSync('userInfo', res.data.userInfo)
uni.setStorageSync('token', res.data.userInfo.token)
uni.setStorageSync(
'userInfo', res
.data.userInfo)
uni.setStorageSync('token',
res.data.userInfo
.token)
uni.navigateTo({
url: '/pages/index/index'
})
... ... @@ -67,4 +117,70 @@
</script>
<style>
@import url("/common/uni.css");
.Login {
min-height: 100vh;
background-color: #fff;
}
.btn {
margin: 0 auto;
margin-top: 320rpx;
width: 424rpx;
height: 80rpx;
background: #ff834d;
border: 2rpx solid #FF834D;
position: relative;
font-size: 32rpx;
color: #fff;
text-align: center;
line-height: 80rpx;
border-radius: 48rpx;
position: relative;
}
.btn1 {
margin: 0 auto;
margin-top: 320rpx;
width: 424rpx;
height: 80rpx;
background: #ff834d;
border: 2rpx solid #FF834D;
position: relative;
font-size: 32rpx;
color: #fff;
text-align: center;
line-height: 80rpx;
border-radius: 48rpx;
opacity: 0.5;
}
button {
width: 426rpx;
height: 84rpx;
position: absolute;
top: 0;
left: 0;
background: transparent;
border-radius: 48rpx;
}
radio {
transform: scale(0.6);
}
.uni-padding-wrap {
margin-top: 40rpx;
}
.title {
font-size: 40rpx;
color: #3ba3e0;
}
.desc {
color: #969799;
font-size: 26rpx;
}
</style>
... ...
<template>
<view class="">
<web-view :src="hrefs"></web-view>
</view>
</template>
<script>
export default{
onLoad(options) {
this.hrefs=options.src
},
data(){
return{
hrefs:''
}
}
}
</script>
<style>
</style>
... ...
... ... @@ -24,7 +24,7 @@
</view>
<view class="header">搜索地址</view>
<view class="list">
<view class="item" @click="addressTapped(item.title,item.location.lat,item.location.lng)" v-for="(item,index) in result"
<view class="item" @click="addressTapped(item.title,item.location.lat,item.location.lng,item.city)" v-for="(item,index) in result"
:key="index">
<text class="title">{{item.title}}</text>
<text class="address">{{item.address}}</text>
... ... @@ -73,6 +73,7 @@
methods: {
//使用当前位置
getNowAdd(){
uni.removeStorageSync('getNowAdd')
uni.redirectTo({
url: '/pages/index/index?address=' +this.nowAddres + '&lat=' + this.lat + '&lot=' + this.lot
})
... ... @@ -118,8 +119,10 @@
complete: function(res) {}
});
},
addressTapped: function(title, lat, lot) {
addressTapped: function(title, lat, lot,city) {
console.log(lat,lot)
uni.setStorageSync('selectCity',city)
uni.setStorageSync('selectCity',title)
// var title = e.currentTarget.dataset.title;
// 取出点中的地址,然后使用WxNotification回传给首页
// WxNotificationCenter.postNotificationName("addressSelectedNotification", title);
... ...
... ... @@ -240,7 +240,6 @@
})
},
//卖闲置
buy() {
request.get('/api/other/xian', {
... ... @@ -273,11 +272,11 @@
goGoodDetail(id) {
if(this.tabIndex==1){
uni.navigateTo({
url: '/pages/index/good-details?id=' + id
url: '/pages/index/good-details?id=' + id+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
}else{
uni.navigateTo({
url: '/pages/index/good-details?goos_id=' + id
url: '/pages/index/good-details?goos_id=' + id+'&lat='+uni.getStorageSync('lat')+'&lot='+uni.getStorageSync('lot')
})
}
// uni.navigateTo({
... ...
<template>
<view class="berCon">
<view class="berInput">
<input type="text" placeholder-class="place-holder" value="" placeholder="请输入商品名称" @input="bindInput" v-model="inputVlaue" />
<input type="text" placeholder-class="place-holder" value="" placeholder="请输入商品名称" @input="bindInput"
v-model="inputVlaue" />
</view>
<view class="berTextarea">
<view class="" style="margin-bottom: 20rpx;">
<textarea class="zd_textarea" value="" placeholder="简要描述物品的型号、新旧程度、转手原因、使用感受吧~" @input="textareaInout" v-model="areaValue" />
</view>
<textarea class="zd_textarea" value="" placeholder="简要描述物品的型号、新旧程度、转手原因、使用感受吧~" @input="textareaInout"
v-model="areaValue" />
</view>
<view class="" style="margin-left: 32rpx;width: 100%;">
<view class="photoImgList" v-for="(item,index) in fileList" :key="index" style="display:inline-block;width: 29.3%;position: relative;margin-right: 1%;">
<view class="photoImgList" v-for="(item,index) in fileList" :key="index"
style="display:inline-block;width: 29.3%;position: relative;margin-right: 1%;">
<image :src="item" mode="" style="width:100%;height:176rpx;"></image>
<view class="" style="position: absolute;top: 0;right: 0;" @click="deleteImg(index)">
<image src="/static/image/close@2x.png" style="width: 52rpx;height: 52rpx;" ></image>
<image src="/static/image/close@2x.png" style="width: 52rpx;height: 52rpx;"></image>
</view>
</view>
<image src="/static/image/tianjia_icon@2x.png" mode="" style="width: 176rpx;height:176rpx;" @click="uploadImg"></image>
<image src="/static/image/tianjia_icon@2x.png" mode="" style="width: 176rpx;height:176rpx;"
@click="uploadImg"></image>
</view>
<view class="berBottom" @click="goMap">
<image src="../../static/image/Frame_11@2x.png" style="width: 32rpx;height: 32rpx;margin-left: 32rpx;" mode=""></image>
<image src="../../static/image/Frame_11@2x.png" style="width: 32rpx;height: 32rpx;margin-left: 32rpx;"
mode=""></image>
<text class="berAddresxz">{{SelectAddress}}</text>
<image src="../../static/image/gengduo_icon_5@2x.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
<image src="../../static/image/gengduo_icon_5@2x.png" style="width: 48rpx;height: 48rpx;" mode="">
</image>
</view>
</view>
</view>
<view class="" style="margin: 0 32rpx;border-radius: 16rpx;margin-bottom: 160rpx;">
<view class="" style="position: relative;">
<view class="">
<van-cell title="价格" />
</view>
<view class="" style="position: absolute;top: 25rpx;left: 195rpx;">
<input type="number" value="" placeholder-class="sizeColor" placeholder="请输入价格" @input="priceInput" v-model="peiceValue"/>
<input type="number" value="" placeholder-class="sizeColor" placeholder="请输入价格" @input="priceInput"
v-model="peiceValue" />
</view>
</view>
<view class="">
<van-cell-group>
<van-cell title="分类" is-link @click="showPickerSelect = true" />
<view class="">
<text class="SelectData" @click="showPickerSelect = true">{{select}}</text>
<van-popup :show="showPickerSelect" position="bottom" >
<van-picker
show-toolbar
value-key="h_name"
:columns="array"
@confirm="bindPickerChange"
@cancel="showPickerSelect = false"
/>
</van-popup>
</view>
<view class="">
<text class="SelectData" @click="showPickerSelect = true">{{select}}</text>
<van-popup :show="showPickerSelect" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="array" @confirm="bindPickerChange"
@cancel="showPickerSelect = false" />
</van-popup>
</view>
</van-cell-group>
</view>
<view class="" v-if="arrayIndex != null">
<van-cell-group>
<van-cell title="分类二" is-link @click="showPickerSelect2 = true" />
<view class="">
<text class="SelectData" @click="showPickerSelect2 = true">{{select2}}</text>
<van-popup :show="showPickerSelect2" position="bottom" >
<van-picker
show-toolbar
value-key="h_name"
:columns="array2"
@confirm="bindPickerChange2"
@cancel="showPickerSelect2 = false"
/>
</van-popup>
</view>
</van-cell-group>
<view class="">
<text class="SelectData" @click="showPickerSelect2 = true">{{select2}}</text>
<van-popup :show="showPickerSelect2" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="array2" @confirm="bindPickerChange2"
@cancel="showPickerSelect2 = false" />
</van-popup>
</view>
</van-cell-group>
</view>
<view class="" >
<van-cell-group>
<van-cell title="新旧程度" is-link @click="showPickerSelects = true" />
<view class="">
<text class="SelectData" @click="showPickerSelects = true">{{degree}}</text>
<van-popup :show="showPickerSelects" position="bottom" >
<van-picker
show-toolbar
value-key="h_name"
:columns="degreeArray"
@confirm="bindPickerDegree"
@cancel="showPickerSelects = false"
/>
</van-popup>
</view>
</van-cell-group>
<view class="">
<van-cell-group>
<van-cell title="新旧程度" is-link @click="showPickerSelects = true" />
<view class="">
<text class="SelectData" @click="showPickerSelects = true">{{degree}}</text>
<van-popup :show="showPickerSelects" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="degreeArray"
@confirm="bindPickerDegree" @cancel="showPickerSelects = false" />
</van-popup>
</view>
</van-cell-group>
</view>
</view>
<view class="BtnBackup">
<view class="BtnBack" @click="publish">
... ... @@ -97,282 +89,314 @@
<script>
import request from '../../utils/request.js'
export default{
data(){
return{
token:false,
SelectAddress:'位置选择',
latitude:'',
longitude:'',
address:'',
inputVlaue:'',
fileList:[],
urlImg:[],
degree:'', //新旧程度
areaValue:'',
peiceValue:'',
showPickerSelects:false, //新旧程度
degreeArray:[],
degreeArrayIndex:'',
degreeId:[],
showPickerSelect:false, //分类
showPickerSelect2:false, //分类二
fileList:[],
username:"",
export default {
data() {
return {
token: false,
SelectAddress: '位置选择',
latitude: '',
longitude: '',
address: '',
inputVlaue: '',
fileList: [],
urlImg: [],
degree: '', //新旧程度
areaValue: '',
peiceValue: '',
showPickerSelects: false, //新旧程度
degreeArray: [],
degreeArrayIndex: '',
degreeId: [],
showPickerSelect: false, //分类
showPickerSelect2: false, //分类二
fileList: [],
username: "",
array: [],
arrayId:[],
arrayIndex:null,
select:'请选择分类',
arrayId: [],
arrayIndex: null,
select: '请选择分类',
array2: [],
arrayId2:[],
arrayIndex2:null,
select2:'请选择分类',
btn:true ,//按钮
tempFilePaths:[] //多张上传
arrayId2: [],
arrayIndex2: null,
select2: '请选择分类',
btn: true, //按钮
tempFilePaths: [] //多张上传
}
},
created() {
if(uni.getStorageSync('token')){
this.token=true
}else{
if (uni.getStorageSync('token')) {
this.token = true
} else {
uni.navigateTo({
url:'/pages/index/login'
url: '/pages/index/login'
})
}
this.classifyList()
this.newOld()
},
methods:{
uploadImg(){
let that =this
that.tempFilePaths=[]
methods: {
uploadImg() {
let that = this
that.tempFilePaths = []
uni.chooseImage({
count: 6,
success: (chooseImageRes) => {
let list=chooseImageRes.tempFilePaths
list.forEach((item,index)=>{
that.tempFilePaths.push(item);
})
let lists=that.tempFilePaths
lists.forEach(ele=>{
// ele.forEach(item=>{
const uploadTask = uni.uploadFile({
url: 'http://muying.t.brotop.cn/api/common/upload',
filePath: ele,
fileType:'image',
// filePath: tempFilePaths[0],
name: 'file',
formData: {
'user': 'test'
},
header: {
'token': uni.getStorageSync('token') || ''
},
success: (uploadFileRes) => {
let uploadList =JSON.parse(uploadFileRes.data).data
that.fileList.push(uploadList.url)
that.urlImg.push(uploadList.save_path)
}
});
// })
})
}
});
count: 6,
success: (chooseImageRes) => {
let list = chooseImageRes.tempFilePaths
list.forEach((item, index) => {
that.tempFilePaths.push(item);
})
let lists = that.tempFilePaths
lists.forEach(ele => {
const uploadTask = uni.uploadFile({
url: 'https://ketao.shequtaoapp.com/api/common/upload',
filePath: ele,
fileType: 'image',
name: 'file',
formData: {
'user': 'test'
},
header: {
'token': uni.getStorageSync('token') || ''
},
success: (uploadFileRes) => {
let uploadList = JSON.parse(uploadFileRes.data).data
that.fileList.push(uploadList.url)
that.urlImg.push(uploadList.save_path)
}
});
// })
})
}
});
},
//删除图片
deleteImg(idx){
deleteImg(idx) {
this.fileList.splice(idx, 1);
this.urlImg.splice(idx,1);
this.tempFilePaths.splice(idx,1);
this.urlImg.splice(idx, 1);
this.tempFilePaths.splice(idx, 1);
},
bindInput(e){
this.inputVlaue=e.detail.value
bindInput(e) {
this.inputVlaue = e.detail.value
},
textareaInout(e){
this.areaValue=e.detail.value
textareaInout(e) {
this.areaValue = e.detail.value
},
priceInput(e){
this.peiceValue=e.detail.value
priceInput(e) {
this.peiceValue = e.detail.value
},
//新旧程度
newOld(){
request.get('/api/push/Mo',{}).then(res=>{
let nameList=[];
let idList=[];
let list=res.data.info.reverse();
list.forEach((item,index)=>{
newOld() {
request.get('/api/push/Mo', {}).then(res => {
let nameList = [];
let idList = [];
let list = res.data.info.reverse();
list.forEach((item, index) => {
nameList.push(item.name);
idList.push(item.id)
})
this.degreeArray=nameList;
this.degreeId=idList;
}).catch(err=>{
this.degreeArray = nameList;
this.degreeId = idList;
}).catch(err => {
})
},
//分类
classifyList(){
request.get('/api/index/fen',{}).then(res=>{
let nameList=[];
let idList=[];
let list=res.data.info;
list.forEach((item,index)=>{
nameList.push(item.name);
idList.push(item.id)
classifyList() {
request.get('/api/index/fen', {}).then(res => {
let nameList = [];
let idList = [];
let list = res.data.info;
list.forEach((item, index) => {
nameList.push(item.name);
idList.push(item.id)
})
this.array = nameList;
this.arrayId = idList;
})
this.array=nameList;
this.arrayId=idList;
})
.catch(err=>{
})
},
bindPickerChange(e){
this.select=e.target.value
this.arrayIndex=e.target.index
.catch(err => {
})
},
bindPickerChange(e) {
this.select = e.target.value
this.arrayIndex = e.target.index
this.showPickerSelect = false
this.classifyList2()
},
//二级分类
classifyList2(){
request.get('/api/push/fenLei',{
id:this.arrayId[this.arrayIndex]
}).then(res=>{
let nameList=[];
let idList=[];
let list=res.data.info;
list.forEach((item,index)=>{
nameList.push(item.name);
idList.push(item.id)
})
this.array2=nameList;
this.arrayId2=idList;
})
.catch(err=>{
})
},
bindPickerChange2(e){
console.log(e,'eeee')
this.select2=e.target.value
this.arrayIndex2=e.target.index
this.showPickerSelect2 = false
},
classifyList2() {
request.get('/api/push/fenLei', {
id: this.arrayId[this.arrayIndex]
}).then(res => {
let nameList = [];
let idList = [];
let list = res.data.info;
list.forEach((item, index) => {
nameList.push(item.name);
idList.push(item.id)
})
this.array2 = nameList;
this.arrayId2 = idList;
})
.catch(err => {
})
},
bindPickerChange2(e) {
this.select2 = e.target.value
this.arrayIndex2 = e.target.index
this.showPickerSelect2 = false
},
//新旧程度
bindPickerDegree(e){
this.degree=e.target.value
this.degreeArrayIndex=e.target.index
bindPickerDegree(e) {
this.degree = e.target.value
this.degreeArrayIndex = e.target.index
this.showPickerSelects = false
},
onFenl(){
onFenl() {
this.showPickerSelect = true
},
//跳转地图
goMap(){
let that =this
goMap() {
let that = this
uni.chooseLocation({
success: function (res) {
that.SelectAddress=res.name
that.address=res.name
that.latitude=res.latitude
that.longitude=res.longitude
}
success: function(res) {
that.SelectAddress = res.name
that.address = res.name
that.latitude = res.latitude
that.longitude = res.longitude
}
});
},
//发布需求
publish(){
if(this.btn){
let that=this
uni.requestSubscribeMessage({
tmplIds: ['4qUJug8414AUoPuJ13DPBRmLcC9blw6Vm4uRq59FSXU'],
success(res) {
if(res['4qUJug8414AUoPuJ13DPBRmLcC9blw6Vm4uRq59FSXU']=='accept'){
request.get('/api/push/xianZhi',{
lat:that.latitude,
lng:that.longitude,
address:that.address,
goods_name:that.inputVlaue,
images:that.urlImg.toString(),
content:that.areaValue,
price:that.peiceValue,
sort_id:that.arrayId[that.arrayIndex],
sort2_id:that.arrayId2[that.arrayIndex2],
damage_id:that.degreeId[that.degreeArrayIndex],
is_notify:1
}).then(res=>{
if(res.code==1){
// this.btn=false
uni.showToast({
title:res.msg,
duration:2000,
icon:'none'
})
that.btn=false
setTimeout(()=>{
uni.navigateTo({
url:'/pages/index/index'
publish() {
if (this.btn) {
let that = this
if (that.inputVlaue == '') {
uni.showToast({
title: '请输入商品名称',
icon: 'none'
})
} else if (that.areaValue == '') {
uni.showToast({
title: '请输入商品描述',
icon: 'none'
})
} else if (that.latitude == '') {
uni.showToast({
title: '请进行位置选择',
icon: 'none'
})
} else if (that.arrayIndex == null) {
uni.showToast({
title: '请选择一级分类',
icon: 'none'
})
} else if (that.arrayIndex2 == null) {
uni.showToast({
title: '请选择二级分类',
icon: 'none'
})
} else if (that.peiceValue == '') {
uni.showToast({
title: '请填写价格',
icon: 'none'
})
} else if (that.degreeArrayIndex == '') {
uni.showToast({
title: '请选择新旧程度',
icon: 'none'
})
} else {
uni.requestSubscribeMessage({
tmplIds: ['4qUJug8414AUoPuJ13DPBRmLcC9blw6Vm4uRq59FSXU'],
success(res) {
if (res['4qUJug8414AUoPuJ13DPBRmLcC9blw6Vm4uRq59FSXU'] == 'accept') {
request.get('/api/push/xianZhi', {
lat: that.latitude,
lng: that.longitude,
address: that.address,
goods_name: that.inputVlaue,
images: that.urlImg.toString(),
content: that.areaValue,
price: that.peiceValue,
sort_id: that.arrayId[that.arrayIndex],
sort2_id: that.arrayId2[that.arrayIndex2],
damage_id: that.degreeId[that.degreeArrayIndex],
is_notify: 1
}).then(res => {
if (res.code == 1) {
that.btn = false
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/index/index'
})
}, 1500)
} else {
uni.showToast({
title: res.msg
})
},1500)
}else{
uni.showToast({
title:res.msg
})
}
})
}else{
request.get('/api/push/xianZhi',{
lat:this.latitude,
lng:this.longitude,
address:this.address,
goods_name:this.inputVlaue,
images:this.urlImg.toString(),
content:this.areaValue,
price:this.peiceValue,
sort_id:this.arrayId[this.arrayIndex],
sort2_id:this.arrayId2[this.arrayIndex2],
damage_id:this.degreeId[this.degreeArrayIndex],
is_notify:''
}).then(res=>{
if(res.code==1){
// this.btn=false
uni.showToast({
title:res.msg,
duration:2000,
icon:'none'
})
this.btn=false
setTimeout(()=>{
uni.navigateTo({
url:'/pages/index/index'
}
})
} else {
request.get('/api/push/xianZhi', {
lat: this.latitude,
lng: this.longitude,
address: this.address,
goods_name: this.inputVlaue,
images: this.urlImg.toString(),
content: this.areaValue,
price: this.peiceValue,
sort_id: this.arrayId[this.arrayIndex],
sort2_id: this.arrayId2[this.arrayIndex2],
damage_id: this.degreeId[this.degreeArrayIndex],
is_notify: ''
}).then(res => {
if (res.code == 1) {
// this.btn=false
uni.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
})
},1500)
}else{
uni.showToast({
title:res.msg
})
}
})
this.btn = false
setTimeout(() => {
uni.navigateTo({
url: '/pages/index/index'
})
}, 1500)
} else {
uni.showToast({
title: res.msg
})
}
})
}
}
}
})
}else{
})
}
} else {
uni.showToast({
title:'请勿重复点击',
icon:'none'
title: '请勿重复点击',
icon: 'none'
})
}
}
}
}
</script>
<style>
@import url("/common/uni.css");
@import url("/common/publish.css");
@import url("/common/uni.css");
@import url("/common/publish.css");
</style>
... ...
<template>
<view class="berCon">
<view class="berInput">
<input type="text" placeholder-class="place-holder" value="" placeholder="请输入商品名称" @input="bindInput" v-model="inputVlaue" />
<input type="text" placeholder-class="place-holder" value="" placeholder="请输入商品名称" @input="bindInput"
v-model="inputVlaue" />
</view>
<view class="berTextarea">
<view class="" style="margin-bottom: 20rpx;">
<textarea class="zd_textarea" value="" placeholder="简要描述物品的型号、新旧程度、转手原因、使用感受吧~" @input="textareaInout" v-model="areaValue" />
</view>
<textarea class="zd_textarea" value="" placeholder="简要描述物品的型号、新旧程度、转手原因、使用感受吧~" @input="textareaInout"
v-model="areaValue" />
</view>
<view class="" style="margin-left: 32rpx;width: 100%;">
<view class="photoImgList" v-for="(item,index) in fileList" :key="index" style="display:inline-block;width: 29.3%;position: relative;margin-right: 1%;">
<view class="photoImgList" v-for="(item,index) in fileList" :key="index"
style="display:inline-block;width: 29.3%;position: relative;margin-right: 1%;">
<image :src="item" mode="" style="width:100%;height:176rpx;"></image>
<view style="position: absolute;top: 0;right: 0;" @click="deleteImg(index)">
<image src="/static/image/close@2x.png" style="width: 52rpx;height: 52rpx;" ></image>
<image src="/static/image/close@2x.png" style="width: 52rpx;height: 52rpx;"></image>
</view>
</view>
<image src="/static/image/tianjia_icon@2x.png" mode="" style="width: 176rpx;height:176rpx;" @click="uploadImg"></image>
<image src="/static/image/tianjia_icon@2x.png" mode="" style="width: 176rpx;height:176rpx;"
@click="uploadImg"></image>
</view>
<view class="berBottom" @click="goMap">
<image src="../../static/image/Frame_11@2x.png" style="width: 32rpx;height: 32rpx;margin-left: 32rpx;" mode=""></image>
<image src="../../static/image/Frame_11@2x.png" style="width: 32rpx;height: 32rpx;margin-left: 32rpx;"
mode=""></image>
<text class="berAddresxz">{{SelectAddress}}</text>
<image src="../../static/image/gengduo_icon_5@2x.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
<image src="../../static/image/gengduo_icon_5@2x.png" style="width: 48rpx;height: 48rpx;" mode="">
</image>
</view>
</view>
</view>
<view class="" style="margin: 0 32rpx;border-radius: 16rpx;margin-bottom: 160rpx;">
<view class="" style="position: relative;">
<view class="">
<van-cell title="价格" />
</view>
<view class="" style="position: absolute;top: 25rpx;left: 195rpx;">
<input type="number" value="" placeholder-class="sizeColor" placeholder="请输入价格" @input="priceInput" v-model="peiceValue"/>
<input type="number" value="" placeholder-class="sizeColor" placeholder="请输入价格" @input="priceInput"
v-model="peiceValue" />
</view>
</view>
<view class="">
<van-cell-group>
<van-cell title="分类" is-link @click="showPickerSelect = true" />
<view class="">
<text class="SelectData" @click="showPickerSelect = true">{{select}}</text>
<van-popup :show="showPickerSelect" position="bottom" >
<van-picker
show-toolbar
value-key="h_name"
:columns="array"
@confirm="bindPickerChange"
@cancel="showPickerSelect = false"
/>
</van-popup>
</view>
<view class="">
<text class="SelectData" @click="showPickerSelect = true">{{select}}</text>
<van-popup :show="showPickerSelect" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="array" @confirm="bindPickerChange"
@cancel="showPickerSelect = false" />
</van-popup>
</view>
</van-cell-group>
</view>
<view class="" v-if="arrayIndex != null">
<van-cell-group>
<van-cell title="分类二" is-link @click="showPickerSelect2 = true" />
<view class="">
<text class="SelectData" @click="showPickerSelect2 = true">{{select2}}</text>
<van-popup :show="showPickerSelect2" position="bottom" >
<van-picker
show-toolbar
value-key="h_name"
:columns="array2"
@confirm="bindPickerChange2"
@cancel="showPickerSelect2 = false"
/>
</van-popup>
</view>
</van-cell-group>
<view class="">
<text class="SelectData" @click="showPickerSelect2 = true">{{select2}}</text>
<van-popup :show="showPickerSelect2" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="array2" @confirm="bindPickerChange2"
@cancel="showPickerSelect2 = false" />
</van-popup>
</view>
</van-cell-group>
</view>
<view class="" >
<van-cell-group>
<van-cell title="新旧程度" is-link @click="showPickerSelects = true" />
<view class="">
<text class="SelectData" @click="showPickerSelects = true">{{degree}}</text>
<van-popup :show="showPickerSelects" position="bottom" >
<van-picker
show-toolbar
value-key="h_name"
:columns="degreeArray"
@confirm="bindPickerDegree"
@cancel="showPickerSelects = false"
/>
</van-popup>
</view>
</van-cell-group>
<view class="">
<van-cell-group>
<van-cell title="新旧程度" is-link @click="showPickerSelects = true" />
<view class="">
<text class="SelectData" @click="showPickerSelects = true">{{degree}}</text>
<van-popup :show="showPickerSelects" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="degreeArray"
@confirm="bindPickerDegree" @cancel="showPickerSelects = false" />
</van-popup>
</view>
</van-cell-group>
</view>
</view>
<view class="BtnBackup">
<view class="BtnBack" @click="publish">
... ... @@ -95,257 +87,265 @@
<script>
import request from '../../utils/request.js'
export default{
data(){
return{
SelectAddress:'位置选择',
address:'',
latitude:'',
longitude:'',
fileList:[],
urlImg:[],
inputVlaue:'',
degree:'', //新旧程度
areaValue:'',
peiceValue:'',
showPickerSelects:false, //新旧程度
degreeArray:[],
degreeArrayIndex:'',
degreeId:[],
showPickerSelect:false, //分类
showPickerSelect2:false, //分类二
username:"",
export default {
data() {
return {
SelectAddress: '位置选择',
address: '',
latitude: '',
longitude: '',
fileList: [],
urlImg: [],
inputVlaue: '',
degree: '', //新旧程度
areaValue: '',
peiceValue: '',
showPickerSelects: false, //新旧程度
degreeArray: [],
degreeArrayIndex: '',
degreeId: [],
showPickerSelect: false, //分类
showPickerSelect2: false, //分类二
username: "",
array: [],
arrayId:[],
arrayId: [],
arrayIndex: null,
select:'请选择分类',
select: '请选择分类',
array2: [],
arrayId2:[],
arrayIndex2:null,
select2:'请选择分类',
btn:true,
tempFilePaths:[] //多张上传
arrayId2: [],
arrayIndex2: null,
select2: '请选择分类',
btn: true,
tempFilePaths: [] //多张上传
}
},
created() {
if(uni.getStorageSync('token')){
}else{
if (uni.getStorageSync('token')) {
} else {
uni.navigateTo({
url:'/pages/index/login'
url: '/pages/index/login'
})
}
this.classifyList()
this.newOld()
console.log(this.arrayIndex==null?'1':this.arrayIndex==''?'2':'3')
},
methods:{
bindInput(e){
this.inputVlaue=e.detail.value
methods: {
bindInput(e) {
this.inputVlaue = e.detail.value
},
textareaInout(e){
this.areaValue=e.detail.value
textareaInout(e) {
this.areaValue = e.detail.value
},
priceInput(e){
this.peiceValue=e.detail.value
priceInput(e) {
this.peiceValue = e.detail.value
},
// uploadImg(){
// let that =this
// uni.chooseImage({
// success: (chooseImageRes) => {
// const tempFilePaths = chooseImageRes.tempFilePaths;
// const uploadTask = uni.uploadFile({
// url: 'http://muying.t.brotop.cn/api/common/upload',
// filePath: tempFilePaths[0],
// name: 'file',
// formData: {
// 'user': 'test'
// },
// header: {
// 'token': uni.getStorageSync('token') || ''
// },
// success: (uploadFileRes) => {
// let uploadList =JSON.parse(uploadFileRes.data).data
// console.log(uploadList)
// that.fileList.push(uploadList.url)
// that.urlImg.push(uploadList.save_path)
// }
// });
// }
// });
// },
uploadImg(){
let that =this
that.tempFilePaths=[]
uploadImg() {
let that = this
that.tempFilePaths = []
uni.chooseImage({
count: 6,
success: (chooseImageRes) => {
let list=chooseImageRes.tempFilePaths
list.forEach((item,index)=>{
that.tempFilePaths.push(item);
})
let lists=that.tempFilePaths
lists.forEach(ele=>{
// ele.forEach(item=>{
const uploadTask = uni.uploadFile({
url: 'http://muying.t.brotop.cn/api/common/upload',
filePath: ele,
fileType:'image',
// filePath: tempFilePaths[0],
name: 'file',
formData: {
'user': 'test'
},
header: {
'token': uni.getStorageSync('token') || ''
},
success: (uploadFileRes) => {
let uploadList =JSON.parse(uploadFileRes.data).data
that.fileList.push(uploadList.url)
that.urlImg.push(uploadList.save_path)
}
});
// })
})
}
});
count: 6,
success: (chooseImageRes) => {
let list = chooseImageRes.tempFilePaths
list.forEach((item, index) => {
that.tempFilePaths.push(item);
})
let lists = that.tempFilePaths
lists.forEach(ele => {
const uploadTask = uni.uploadFile({
url: 'https://ketao.shequtaoapp.com/api/common/upload',
filePath: ele,
fileType: 'image',
name: 'file',
formData: {
'user': 'test'
},
header: {
'token': uni.getStorageSync('token') || ''
},
success: (uploadFileRes) => {
let uploadList = JSON.parse(uploadFileRes.data).data
that.fileList.push(uploadList.url)
that.urlImg.push(uploadList.save_path)
}
});
})
}
});
},
//删除图片
deleteImg(idx){
deleteImg(idx) {
this.fileList.splice(idx, 1);
this.urlImg.splice(idx,1);
this.tempFilePaths.splice(idx,1);
this.urlImg.splice(idx, 1);
this.tempFilePaths.splice(idx, 1);
},
//新旧程度
newOld(){
request.get('/api/push/Mo',{}).then(res=>{
let nameList=[];
let idList=[];
let list=res.data.info.reverse();
list.forEach((item,index)=>{
newOld() {
request.get('/api/push/Mo', {}).then(res => {
let nameList = [];
let idList = [];
let list = res.data.info.reverse();
list.forEach((item, index) => {
nameList.push(item.name);
idList.push(item.id)
})
this.degreeArray=nameList;
this.degreeId=idList;
}).catch(err=>{
this.degreeArray = nameList;
this.degreeId = idList;
}).catch(err => {
})
},
//分类
classifyList(){
request.get('/api/index/fen',{}).then(res=>{
let nameList=[];
let idList=[];
let list=res.data.info;
list.forEach((item,index)=>{
nameList.push(item.name);
idList.push(item.id)
classifyList() {
request.get('/api/index/fen', {}).then(res => {
let nameList = [];
let idList = [];
let list = res.data.info;
list.forEach((item, index) => {
nameList.push(item.name);
idList.push(item.id)
})
this.array = nameList;
this.arrayId = idList;
})
this.array=nameList;
this.arrayId=idList;
})
.catch(err=>{
})
},
bindPickerChange(e){
this.select=e.target.value
this.arrayIndex=e.target.index
.catch(err => {
})
},
bindPickerChange(e) {
this.select = e.target.value
this.arrayIndex = e.target.index
this.$forceUpdate()
this.showPickerSelect = false
this.classifyList2()
},
//二级分类
classifyList2(){
request.get('/api/push/fenLei',{
id:this.arrayId[this.arrayIndex]
}).then(res=>{
let nameList=[];
let idList=[];
let list=res.data.info;
list.forEach((item,index)=>{
nameList.push(item.name);
idList.push(item.id)
})
this.array2=nameList;
this.arrayId2=idList;
})
.catch(err=>{
})
},
bindPickerChange2(e){
this.select2=e.target.value
this.arrayIndex2=e.target.index
this.showPickerSelect2 = false
},
classifyList2() {
request.get('/api/push/fenLei', {
id: this.arrayId[this.arrayIndex]
}).then(res => {
let nameList = [];
let idList = [];
let list = res.data.info;
list.forEach((item, index) => {
nameList.push(item.name);
idList.push(item.id)
})
this.array2 = nameList;
this.arrayId2 = idList;
})
.catch(err => {
})
},
bindPickerChange2(e) {
this.select2 = e.target.value
this.arrayIndex2 = e.target.index
this.showPickerSelect2 = false
},
//新旧程度
bindPickerDegree(e){
this.degree=e.target.value
this.degreeArrayIndex=e.target.index
bindPickerDegree(e) {
this.degree = e.target.value
this.degreeArrayIndex = e.target.index
this.showPickerSelects = false
},
onFenl(){
onFenl() {
this.showPickerSelect = true
},
},
//跳转地图
goMap(){
goMap() {
let that = this;
uni.chooseLocation({
success: function (res) {
that.SelectAddress=res.name
that.address=res.name
that.latitude=res.latitude
that.longitude=res.longitude
},
success: function(res) {
that.SelectAddress = res.name
that.address = res.name
that.latitude = res.latitude
that.longitude = res.longitude
},
});
},
//发布需求
publish(){
if(this.btn){
request.get('/api/push/xuQiu',{
lat:this.latitude,
lng:this.longitude,
address:this.address,
need_name:this.inputVlaue,
images:this.urlImg.toString(),
content:this.areaValue,
price:this.peiceValue,
sort_id:this.arrayId[this.arrayIndex],
sort2_id:this.arrayId2[this.arrayIndex2],
damage_id:this.degreeId[this.degreeArrayIndex]
}).then(res=>{
if(res.code==1){
this.btn=false
uni.showToast({
title:'发布成功',
duration:2000,
icon:'success'
})
setTimeout(()=>{
uni.navigateTo({
url:'/pages/index/index'
publish() {
if (this.btn) {
if (this.inputVlaue == '') {
uni.showToast({
title: '请输入商品名称',
icon: 'none'
})
} else if (this.areaValue == '') {
uni.showToast({
title: '请输入商品描述',
icon: 'none'
})
} else if (this.latitude == '') {
uni.showToast({
title: '请选择地址',
icon: 'none'
})
} else if (this.peiceValue == '') {
uni.showToast({
title: '请选择商品价格',
icon: 'none'
})
} else if (this.arrayIndex == null) {
uni.showToast({
title: '请选择一级分类',
icon: 'none'
})
} else if (this.arrayIndex2 == null) {
uni.showToast({
title: '请选择二级分类',
icon: 'none'
})
} else if (this.degree == '') {
uni.showToast({
title: '请选择新旧程度',
icon: 'none'
})
} else {
this.btn = false
request.get('/api/push/xuQiu', {
lat: this.latitude,
lng: this.longitude,
address: this.address,
need_name: this.inputVlaue,
images: this.urlImg.toString(),
content: this.areaValue,
price: this.peiceValue,
sort_id: this.arrayId[this.arrayIndex],
sort2_id: this.arrayId2[this.arrayIndex2],
damage_id: this.degreeId[this.degreeArrayIndex] || ''
}).then(res => {
if (res.code == 1) {
this.btn = false
uni.showToast({
title: '发布成功',
duration: 2000,
icon: 'success'
})
},1500)
}else{
uni.showToast({
title:res.msg
})
}
}).catch(err=>{
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/index/index'
})
}, 1500)
} else {
uni.showToast({
title: res.msg
})
}
}).catch(err => {})
}
}
}
}
}
</script>
<style>
@import url("/common/uni.css");
@import url("/common/publish.css");
@import url("/common/uni.css");
@import url("/common/publish.css");
</style>
... ...