调部分接口

master
Lee 2022-10-20 21:07:14 +08:00
parent 086e539f1f
commit 0bfe6d07f4
61 changed files with 832 additions and 702 deletions

View File

@ -4,7 +4,7 @@
projectname:'', //
lat:'', //
lng:'' ,//
hostapi:'https://laonon.scdxtc.cn' //
hostapi:'https://idle.scdxtc.cn' //
},
};
</script>
@ -22,7 +22,8 @@
@import url("./commons/loading.css");
/* 加载中样式 end */
/* 设置背景颜色 */
/* 设置背景颜色 start */
page{ background-color: #f5f5f5;}
/* 设置背景颜色 end */
</style>

View File

@ -39,9 +39,15 @@
methods:{
//
goDetail(id){
uni.navigateTo({
url:`/pages/goods/detail?id=${id}`,
})
if(this.isOperate){
uni.navigateTo({
url:`/pages/goods/detail?id=${id}&type=release`,
})
}else{
uni.navigateTo({
url:`/pages/goods/detail?id=${id}`,
})
}
},
//
@ -67,7 +73,7 @@
}
.goods-list .cover{
width: 100%;
height: 350rpx;
height: 320rpx;
overflow: hidden;
margin-bottom: 10rpx;
position: relative;

View File

@ -14,7 +14,8 @@
<view class="tab-title" :style="{color: titleColor,justifyContent: ifCenter ? 'center' : '',padding: ifCenter ? '0px' : `${ifReturn ? '0 38' : '0 15'}px`}">
<view class="title-box" :class="['','clips1','clips2'][clipNumber*1]" :style="{maxWidth: ifCenter ? '360rpx' : '70%'}">
<!-- 有网络 -->
<view v-if="ifTitle && ifNet">{{navBarTitle}}</view>
<view @tap="choiceEstate(estate)" v-if="estate!==0 && ifTitle && ifNet">{{navBarTitle}}</view>
<view v-if="estate==0 && ifTitle && ifNet">{{navBarTitle}}</view>
<!-- 无网络 -->
<view v-if="!ifNet">{{netText}}<text @tap="refreshEv" style="color: #3875F6;margin-left: 20rpx;">刷新</text></view>
</view>
@ -81,6 +82,11 @@
type: String,
default: '0'
},
//
estate:{
type: Number,
default: 0
}
},
data() {
return {
@ -128,6 +134,12 @@
})
}
})
},
//
choiceEstate(estate){
uni.navigateTo({
url: `/pages/estate/estate?estate=${estate}`
})
}
}
}

View File

@ -24,37 +24,17 @@
},
data() {
return {
footBarList:[], //
footBarList:[
{iconPath:'/static/icon-idle.png',title:'闲置'},
{iconPath:'/static/icon-my.png',title:'我的'}
], //
};
},
mounted() {
//
this.$toolAll.tools.obtainPagePath();
//
this.getTabbarList();
},
methods:{
//
getTabbarList(){
this.footBarList = [
{iconPath:'/static/icon-idle.png',title:'闲置'},
{iconPath:'/static/icon-my.png',title:'我的'}
]
// this.$requst.get('/api/index/mini-program-setting').then(res=>{
// if(res.code == 0){
// console.log(res,'')
// let tabbarArr = [];
// res.data.footBar.forEach(item=>{
// let obj = {
// iconPath:this.$hostHttp+item.icon,
// title:item.name,
// }
// tabbarArr.push(obj)
// })
// this.footBarList = tabbarArr;
// }
// })
},
// tabbar
chooseFootTab(index){
switch (index){
@ -75,9 +55,11 @@
//
goRelease(){
uni.navigateTo({
url:'/pages/idle/release',
})
if(this.$toolAll.tools.judgeAuth()) {
uni.navigateTo({
url:'/pages/idle/release',
})
}
},
}
}

View File

@ -6,6 +6,7 @@ const goLogin = () => {
})
}
let flag = true;
// 刷新token并跳转到当前页面
var authTimer = null;
const refreshTokenPage = () => {
@ -24,10 +25,9 @@ const refreshTokenPage = () => {
uni.login({
success: (res) => {
uni.request({
url:'https://laonon.scdxtc.cn/api/user/login',
url:`${getApp().globalData.hostapi}/api/v1/user/login`,
data:{
code:res.code,
invite_code:uni.getStorageSync('inviteCode')?uni.getStorageSync('inviteCode'):'',
},
success: (result) => {
if(result.data.code == 0) {
@ -37,7 +37,6 @@ const refreshTokenPage = () => {
uni.setStorageSync('expire',result.data.data.expire);//缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active',result.data.data.phone_active);//是否授权手机号
uni.setStorageSync('is_active',result.data.data.is_active);//是否授权头像和昵称
uni.setStorageSync('invite_code',result.data.data.invite_code);//缓存邀请码
// 重新进入当前页面
uni.reLaunch({
url:localRoute
@ -50,6 +49,7 @@ const refreshTokenPage = () => {
}
flag = true;
}
// 请求错误处理
const checkError = (e) => {
console.log('500接口错误');
@ -153,6 +153,7 @@ const request = (method, url, options) => {
})
})
}
// 上传文件 封装请求
const uploadFile = (url, options) => {
let tempData = options || {}
@ -179,7 +180,6 @@ const uploadFile = (url, options) => {
})
}
export default {
get: (url, options) => {
return request('get', url, options)

View File

@ -272,7 +272,7 @@ const tools = {
})
.replace('<section', '<div')
.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, p1) => {
return `<img mode="widthFix" style="max-width:100%!important;height:auto" src='${p1.indexOf('http') > -1 ? p1 : 'https://laonon.scdxtc.cn' + p1}' />`
return `<img mode="widthFix" style="max-width:100%!important;height:auto" src='${p1.indexOf('http') > -1 ? p1 : 'https://idle.scdxtc.cn' + p1}' />`
})
},
/**

View File

@ -19,7 +19,7 @@ import requst from '@/jsFile/requst.js';
Vue.prototype.$requst = requst;
//公共域名
Vue.prototype.$hostHttp = 'https://laonon.scdxtc.cn';
Vue.prototype.$hostHttp = 'https://idle.scdxtc.cn';
//不显示console.log
if (uni.getSystemInfoSync().platform !== "devtools") {

View File

@ -1,5 +1,5 @@
{
"name" : "老农极鲜土货",
"name" : "小区闲置",
"appid" : "__UNI__768F35C",
"description" : "这是一款基于uniapp开发的app和微信小程序的模板框架",
"versionName" : "1.0.0",
@ -69,7 +69,7 @@
/* */
"mp-weixin" : {
/* */
"appid" : "wx19c92fb80708ae46",
"appid" : "wxf6f7c457ee92d2ac",
"setting" : {
"urlCheck" : true,
"es6" : true,
@ -81,9 +81,7 @@
"desc" : "您的位置信息,将用于附近小区查询!"
}
},
"requiredPrivateInfos": [
"getLocation"
]
"requiredPrivateInfos" : [ "getLocation" ]
},
"mp-baidu" : {
"appid" : "24346353"

View File

@ -4,7 +4,7 @@
<status-nav :ifReturn="false" navBarTitle="小区选择"></status-nav>
<!-- 小区列表 -->
<view class="estate-list background-white pad-zy20 border-box">
<view class="item font26 flex" @tap="choiseEstate" v-for="(item,index) in estateList" :key="index">{{item.name}}</view>
<view class="item font26 flex" @tap="choiseEstate(item.id,item.name)" v-for="(item,index) in estateList" :key="index">{{item.name}}</view>
</view>
<!-- 进入主页 -->
<view class="back-idle flex" :style="{top:statusHeight+'px'}" @tap="backIdle">
@ -24,15 +24,18 @@
return {
statusHeight:uni.getSystemInfoSync().statusBarHeight, //
estateList:[], //
keyword:'', //
page:1, //
size:10, //
total:0, //
isLoading:false, //
estate:0, //0:,1:,2:
}
},
onLoad() {
//
this.getLocation();
onLoad(op) {
if(op.estate) this.estate = op.estate;
//
this.getEstateList();
},
onReachBottom(e) {
if(this.estateList.length<this.total){
@ -49,8 +52,6 @@
geocode:true, // true
success: (res)=> {
console.log('位置信息',res)
//
this.getEstateList();
},
fail: (err)=> {
uni.showToast({
@ -60,55 +61,54 @@
}
});
},
//
//
getEstateList(){
this.estateList = [
{id:1,name:'奥园广场一期',state:0},
{id:2,name:'奥园广场二期',state:0},
{id:3,name:'奥园广场三期',state:0},
{id:4,name:'万圣家园A区',state:0},
{id:5,name:'万圣家园B区',state:0},
{id:6,name:'万圣家园C区',state:0}
]
this.isLoading = true;
// uni.showLoading({
// title:''
// })
// let params = {
// page:this.page,
// size:this.size,
// addr_id:id
// }
// this.$requst.get('/api/spu/list',params).then(res=>{
// if(res.code == 0){
// console.log(res,'')
// this.total = res.data.total;
// let goodsArr = [];
// res.data.list.forEach(item=>{
// let obj = {
// id:item.id,
// cover:item.cover,
// name:item.name,
// price:item.price
// }
// goodsArr.push(obj)
// })
// this.goodsList = this.goodsList.concat(goodsArr);
// }
// uni.hideLoading();
// this.isLoading = true;
// })
uni.showLoading({
title:'加载中'
})
let params = {
page:this.page,
size:this.size
}
if(this.page==1) this.estateList = [];
this.$requst.get('/api/v1/goods/area',params).then(res=>{
if(res.code == 0){
console.log(res,'小区列表')
this.total = res.data.total;
let estateArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
name:item.title,
}
estateArr.push(obj)
})
this.estateList = this.estateList.concat(estateArr);
}
uni.hideLoading();
this.isLoading = true;
})
},
//
choiseEstate(id){
uni.reLaunch({
url:`/pages/idle/idle`
})
choiseEstate(id,name){
//
uni.setStorageSync('area_id',id);
uni.setStorageSync('area_name',name);
if(this.estate == 1){
uni.reLaunch({
url:`/pages/idle/idle`
})
}
},
//
backIdle(){
if(!uni.getStorageSync('area_id')||!uni.getStorageSync('area_name')){
uni.setStorageSync('area_id',this.estateList[0].id);
uni.setStorageSync('area_name',this.estateList[0].name);
}
uni.reLaunch({
url:`/pages/idle/idle`
})

View File

@ -1,5 +1,5 @@
<template>
<view class="pad-x120" v-if="isLoading">
<view :class="type==''?'':'pad-x120'" v-if="isLoading">
<!-- 头部 -->
<status-nav :ifReturn="true" navBarTitle="商品详情"></status-nav>
<!-- 提示 -->
@ -38,7 +38,7 @@
</view>
</view>
</view>
<view class="detail-btns background-white border-box flex">
<view class="detail-btns background-white border-box flex" v-if="type=='release'">
<view class="btn background-orange font30 color-ff radius35 flex" @tap="delEv(goodsDetail.id)"></view>
<view class="btn background-blue font30 color-ff radius35 flex" @tap="editEv(goodsDetail.id)"></view>
</view>
@ -52,12 +52,21 @@
goodsDetail:{}, //
goodsImg:[], //
showPhone:false, //
isLoading:false, //
isLoading:false, //
type:'', //
}
},
onShow() {
//
this.getGoodsDetail();
onLoad(op) {
if(op.type=='release'){
this.type = op.type;
}
if(op.id){
//
this.getGoodsDetail(op.id);
}else{
this.$toolAll.tools.showToast('参数不合法');
}
},
onShareAppMessage(res) {
let shareObj = {
@ -80,34 +89,48 @@
},
methods: {
//
getGoodsDetail(){
this.goodsDetail = {
name:'儿童自行车',
category_id:3,
category_name:'儿童玩具',
original_price:'120.00',
price:'30.00',
phone:'18683958573',
imgSrc:'/static/index-01.png,/static/index-02.png,/static/index-03.png',
msg:'九成新儿童自行车,现在小孩到了,已经用不到了,有需要的可以联系哟!'
}
//
this.goodsImg = this.goodsDetail.imgSrc.split(',');
this.isLoading = true;
getGoodsDetail(id){
uni.showLoading({
title:'加载中'
})
this.$requst.get('/api/v1/goods/detail',{id:id}).then(res=>{
if(res.code == 0){
console.log(res,'闲置商品详情');
this.goodsDetail = {
id:res.data.id,
cover:res.data.cover,
name:res.data.title,
category_name:res.data.category_name,
original_price:res.data.original_price,
price:res.data.price,
phone:res.data.phone,
images:res.data.images,
msg:res.data.content
};
//
this.goodsImg = this.goodsDetail.images;
}
uni.hideLoading();
this.isLoading = true;
})
},
//
editEv(id){
uni.navigateTo({
url:`/pages/release/release?id=3`,
url:`/pages/release/release?id=${id}`,
})
},
//
delEv(){
uni.navigateTo({
url:`/pages/goods/goods`,
delEv(id){
this.$requst.post('/api/v1/goods/del',{id:id}).then(res=>{
if(res.code == 0){
this.$toolAll.tools.showToast('删除成功');
uni.navigateTo({
url:`/pages/goods/goods`,
})
}
})
},
}

View File

@ -57,48 +57,34 @@
methods: {
//
getGoodsList(){
this.goodsList = [
{id:0,name:'儿童自行车',cover:'/static/index-01.png',price:'30.00',original_price:'120.00',state:1},
{id:0,name:'儿童手表',cover:'/static/index-02.png',price:'480.00',original_price:'160.00',state:1},
{id:0,name:'尿布台',cover:'/static/index-03.png',price:'120.00',original_price:'480.00',state:0},
{id:0,name:'儿童自行车',cover:'/static/index-01.png',price:'30.00',original_price:'120.00',state:1},
{id:0,name:'儿童手表',cover:'/static/index-02.png',price:'480.00',original_price:'160.00',state:1},
{id:0,name:'尿布台',cover:'/static/index-03.png',price:'120.00',original_price:'480.00',state:0},
{id:0,name:'儿童自行车',cover:'/static/index-01.png',price:'30.00',original_price:'120.00',state:1},
{id:0,name:'儿童手表',cover:'/static/index-02.png',price:'480.00',original_price:'160.00',state:1},
{id:0,name:'尿布台',cover:'/static/index-03.png',price:'120.00',original_price:'480.00',state:0},
{id:0,name:'儿童自行车',cover:'/static/index-01.png',price:'30.00',original_price:'120.00',state:1},
{id:0,name:'儿童手表',cover:'/static/index-02.png',price:'480.00',original_price:'160.00',state:1},
{id:0,name:'尿布台',cover:'/static/index-03.png',price:'120.00',original_price:'480.00',state:1}
]
this.isLoading = true;
// uni.showLoading({
// title:''
// })
// let params = {
// page:this.page,
// size:this.size,
// addr_id:id
// }
// this.$requst.get('/api/spu/list',params).then(res=>{
// if(res.code == 0){
// console.log(res,'')
// this.total = res.data.total;
// let goodsArr = [];
// res.data.list.forEach(item=>{
// let obj = {
// id:item.id,
// cover:item.cover,
// name:item.name,
// price:item.price
// }
// goodsArr.push(obj)
// })
// this.goodsList = this.goodsList.concat(goodsArr);
// }
// uni.hideLoading();
// this.isLoading = true;
// })
uni.showLoading({
title:'加载中'
})
let params = {
page:this.page,
size:this.size,
}
if(this.page==1) this.goodsList = [];
this.$requst.get('/api/v1/user/goods',params).then(res=>{
if(res.code == 0){
console.log(res,'我的发布列表')
this.total = res.data.total;
let goodsArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
cover:item.cover,
name:item.title,
original_price:item.original_price,
price:item.price
}
goodsArr.push(obj)
})
this.goodsList = this.goodsList.concat(goodsArr);
}
uni.hideLoading();
this.isLoading = true;
})
},
//

View File

@ -1,11 +1,11 @@
<template>
<view class="pad-x120" v-if="isLoading">
<!-- 头部 -->
<status-nav :ifReturn="false" navBarTitle="奥园三期-闲置商品" :ifCenter="false"></status-nav>
<status-nav :ifReturn="false" :navBarTitle="pageTitle" :estate="1" :ifCenter="false"></status-nav>
<!-- 商品列表 -->
<goods-list :goodsList="goodsList"></goods-list>
<!-- 没有更多 -->
<view class="no-more mar-s20 font24 color-99">没有更多数据</view>
<view class="no-more mar-s20 font24 color-99" v-if="goodsList.length==total"></view>
<!-- 尾部 -->
<tabbar></tabbar>
</view>
@ -21,16 +21,27 @@
data() {
return {
statusHeight:uni.getSystemInfoSync().statusBarHeight, //
pageTitle:'', //
goodsList:[], //
category_id:0, //id
keyword:'', //
page:1, //
size:10, //
total:0, //
isLoading:false, //
area_id:0, //id
}
},
onShow() {
//
this.getGoodsList();
onLoad() {
if(uni.getStorageSync('area_id')&&uni.getStorageSync('area_name')){
this.area_id = uni.getStorageSync('area_id');
this.pageTitle = uni.getStorageSync('area_name')+'-闲置商品';
//
this.getGoodsList();
}else{
//
this.getEstateList();
}
},
onShareAppMessage(res) {
let shareObj = {
@ -59,56 +70,48 @@
}
},
methods: {
//
getGoodsList(){
this.goodsList = [
{id:0,name:'儿童自行车',cover:'/static/index-01.png',price:'30.00',original_price:'120.00',state:1},
{id:0,name:'儿童手表',cover:'/static/index-02.png',price:'480.00',original_price:'160.00',state:1},
{id:0,name:'尿布台',cover:'/static/index-03.png',price:'120.00',original_price:'480.00',state:1},
{id:0,name:'儿童自行车',cover:'/static/index-01.png',price:'30.00',original_price:'120.00',state:1},
{id:0,name:'儿童手表',cover:'/static/index-02.png',price:'480.00',original_price:'160.00',state:1},
{id:0,name:'尿布台',cover:'/static/index-03.png',price:'120.00',original_price:'480.00',state:1},
{id:0,name:'儿童自行车',cover:'/static/index-01.png',price:'30.00',original_price:'120.00',state:1},
{id:0,name:'儿童手表',cover:'/static/index-02.png',price:'480.00',original_price:'160.00',state:1},
{id:0,name:'尿布台',cover:'/static/index-03.png',price:'120.00',original_price:'480.00',state:1},
{id:0,name:'儿童自行车',cover:'/static/index-01.png',price:'30.00',original_price:'120.00',state:1},
{id:0,name:'儿童手表',cover:'/static/index-02.png',price:'480.00',original_price:'160.00',state:1},
{id:0,name:'尿布台',cover:'/static/index-03.png',price:'120.00',original_price:'480.00',state:1}
]
this.isLoading = true;
// uni.showLoading({
// title:''
// })
// let params = {
// page:this.page,
// size:this.size,
// addr_id:id
// }
// this.$requst.get('/api/spu/list',params).then(res=>{
// if(res.code == 0){
// console.log(res,'')
// this.total = res.data.total;
// let goodsArr = [];
// res.data.list.forEach(item=>{
// let obj = {
// id:item.id,
// cover:item.cover,
// name:item.name,
// price:item.price
// }
// goodsArr.push(obj)
// })
// this.goodsList = this.goodsList.concat(goodsArr);
// }
// uni.hideLoading();
// this.isLoading = true;
// })
//
getEstateList(){
this.$requst.get('/api/v1/goods/area').then(res=>{
if(res.code == 0){
this.area_id = res.data.list[0].id;
this.pageTitle = res.data.list[0].title+'-闲置商品';
//
this.getGoodsList();
}
})
},
//
goDetail(id){
uni.navigateTo({
url:`/pages/index/detail?id=${id}`
//
getGoodsList(){
uni.showLoading({
title:'加载中'
})
let params = {
page:this.page,
size:this.size,
area_id:this.area_id
}
if(this.page==1) this.goodsList = [];
this.$requst.get('/api/v1/goods/list',params).then(res=>{
if(res.code == 0){
console.log(res,'闲置商品列表')
this.total = res.data.total;
let goodsArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
cover:item.cover,
name:item.title,
original_price:item.original_price,
price:item.price
}
goodsArr.push(obj)
})
this.goodsList = this.goodsList.concat(goodsArr);
}
uni.hideLoading();
this.isLoading = true;
})
},
}

View File

@ -19,6 +19,15 @@
<view class="title">商品名称<text class="color-red">*</text></view>
<input type="text" v-model="goodsDetail.name" placeholder="请输入商品名称" placeholder-style="color:#8c8c9b">
</view>
<view class="item font26 mar-x30 flex">
<view class="title">小区选择<text class="color-red">*</text></view>
<picker mode="selector" :range="estateList" @change="choiceEstate" :value="cateIndex" :range-key="'name'">
<view class="cate-name">
<text>{{estateList[estateIndex].name}}</text>
<image src="/static/icon-arrow-down.png" mode=""></image>
</view>
</picker>
</view>
<view class="item font26 mar-x30 flex">
<view class="title">商品原价<text class="color-red">*</text></view>
<input type="number" v-model="goodsDetail.original_price" placeholder="请输入商品原价" placeholder-style="color:#8c8c9b">
@ -31,13 +40,24 @@
<view class="title">商品描述<text class="color-red">*</text></view>
<textarea v-model="goodsDetail.msg" placeholder="请输入商品描述" placeholder-style="color:#8c8c9b"></textarea>
</view>
<view class="item font26 mar-x30 flex">
<view class="title">封面图<text class="color-red">*</text></view>
<view class="upload-box border-box flex">
<view class="img radius10 border-box" v-if="cover!==''">
<image :src="cover" mode="widthFix"></image>
<image class="del-btn" src="/static/icon-del.png" mode="widthFix" @tap="cover=''"></image>
</view>
<view class="upload-btn radius10 border-box flex" @tap="changeImg('cover')" v-if="cover==''"><image src="/static/icon-release.png" mode="widthFix"></image></view>
</view>
</view>
<view class="item font26 mar-x30 flex">
<view class="title">商品图片<text class="color-red">*</text></view>
<view class="upload-box border-box flex">
<view class="img radius10 border-box" v-for="(item,index) in goodsImg" :key="index">
<image :src="item" mode="widthFix"></image>
<image :src="item.imgSrc" mode="widthFix"></image>
<image class="del-btn" src="/static/icon-del.png" mode="widthFix" @tap="delImg(index)"></image>
</view>
<view class="upload-btn radius10 border-box flex" @tap="changeImg"><image src="/static/icon-release.png" mode="widthFix"></image></view>
<view class="upload-btn radius10 border-box flex" @tap="changeImg('img')" v-if="goodsImg.length<4"><image src="/static/icon-release.png" mode="widthFix"></image></view>
</view>
</view>
<view class="item font26 mar-x30 flex">
@ -54,12 +74,18 @@
return {
statusHeight:uni.getSystemInfoSync().statusBarHeight, //
pageTitle:'', //
estateList:[], //
estateIndex:0, //
cateList:[], //
cateIndex:0, //
goodsDetail:{}, //
cover:'', //
goodsImg:[], //
isEdit:false, //
isLoading:false, //
page:1, //
size:100, //
StagingImg:'', //img
}
},
onLoad(op) {
@ -70,8 +96,8 @@
}else{
this.pageTitle = '新增商品';
}
},
onShow() {
//
this.getEstateList();
//
this.getCateList();
},
@ -95,15 +121,41 @@
return shareObj;
},
methods: {
//
getEstateList(){
this.$requst.get('/api/v1/goods/area').then(res=>{
if(res.code == 0){
console.log(res,'小区列表')
let estateArr = [];
res.data.list.forEach(item=>{
let obj = {
id:item.id,
name:item.title,
}
estateArr.push(obj)
})
this.estateList = this.estateList.concat(estateArr);
}
})
},
//
getCateList(){
this.cateList = [
{id:1,name:'图文书籍'},
{id:2,name:'母婴用品'},
{id:3,name:'儿童玩具'},
{id:4,name:'数码设备'},
{id:5,name:'家用电器'}
]
if(this.page==1) this.goodsList = [];
this.$requst.get('/api/v1/goods/category').then(res=>{
if(res.code == 0){
console.log(res,'物品分类列表')
let cateArr = [];
res.data.forEach(item=>{
let obj = {
id:item.id,
name:item.title
}
cateArr.push(obj)
})
this.cateList = cateArr;
}
})
if(this.isEdit){
//
this.getGoodsDetail();
@ -124,40 +176,82 @@
msg:'九成新儿童自行车,现在小孩到了,已经用不到了,有需要的可以联系哟!'
}
//
this.goodsImg = this.goodsDetail.imgSrc.split(',');
// this.goodsImg = this.goodsDetail.imgSrc.split(',');
//
this.cateIndex = this.cateList.findIndex(item=> item.id === this.goodsDetail.category_id);
this.isLoading = true;
},
//
addGoodsEv(){
let params = {
title:this.goodsDetail.name,
cover:this.cover,
category_id:this.goodsDetail.category_id,
area_id:this.goodsDetail.area_id,
phone:this.goodsDetail.phone,
original_price:this.goodsDetail.original_price,
price:this.goodsDetail.price,
// images:this.goodsImg.toString().replace(','),
content:this.goodsDetail.msg
}
this.$requst.post('/api/v1/goods/add',params).then(res=>{
if(res.code == 0){
}
})
},
//
choiceCate(e){
this.cateIndex = e.detail.value;
},
//
choiceEstate(e){
this.estateIndex = e.detail.value;
},
//
changeImg(){
changeImg(type){
if(type=='cover') this.cover = '';
uni.chooseImage({
count: 1, //9
sourceType: ['album','camera'], //
success: (res)=> {
this.headImg = res.tempFilePaths[0];
this.uploadImg();
this.StagingImg = res.tempFilePaths[0];
//
this.uploadImg(type);
}
})
},
//
uploadImg(){
uploadImg(type){
uni.showLoading({
title: '上传中'
});
this.$requst.upload('/api/file/upload/image',{path:this.headImg}).then(res=>{
this.$requst.upload('/api/v1/file/upload/image',{path:this.StagingImg}).then(res=>{
if(res.code==0) {
this.headImgUrl = this.$hostHttp+res.data.src;
console.log(this.$hostHttp+res.data.src,1111)
if(type=='cover'){
this.cover = this.$hostHttp+res.data.src;
}
if(type=='img'){
let goodsObj = {};
goodsObj = {
imgSrc:this.$hostHttp+res.data.src
}
this.goodsImg.push(goodsObj);
}
}
uni.hideLoading();
})
},
//
delImg(index){
this.goodsImg.splice(index,1);
}
}
}
@ -224,20 +318,32 @@
height: 16rpx;
}
.release-form .item>.upload-box{
flex-wrap: wrap;
box-sizing: border-box;
width: calc(100% - 140rpx);
}
.release-form .item .img,
.release-form .item .upload-btn{
width: 140rpx;
height: 140rpx;
margin-right: 10rpx;
position: relative;
width: 132rpx;
height: 132rpx;
margin: 10rpx 10rpx 0 0;
overflow: hidden;
}
.release-form .item .img>image{
.release-form .item>.img:nth-of-type(4n){
margin-right: 0;
}
.release-form .item .img>image:first-child{
width: 100%;
min-height: 100%;
}
.release-form .item .img>.del-btn{
width: 30rpx;
height: 30rpx;
position: absolute;
right: 2rpx;
top: 2rpx;
}
.release-form .item .upload-btn{
justify-content: center;
align-items: center;

View File

@ -36,18 +36,22 @@
this.appletName = res.data.appletName;
})
},
refuse(){//
//
refuse(){
this.isShowP=false;
this.$toolAll.tools.showToast('登录成功','success')
uni.reLaunch({url:'/pages/idle/idle'})
},
getphonenumber(e){//
//
getphonenumber(e){
let ya = this;
wx.login({
success:(res)=>{
this.$requst.post('/api/user/login',{code:res.code}).then(result => {
this.$requst.post('/api/v1/user/login',{code:res.code}).then(result => {
if(e.detail.errMsg=="getPhoneNumber:ok"){
this.$requst.post('user/bind-phone',{openid: result.data.openid,session_key:result.data.session_key, iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
this.$requst.post('/api/v1/user/bind-phone',{openid: result.data.openid,session_key:result.data.session_key, iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
console.log('手机号信息:',res);
if(res.code==0){
this.$toolAll.tools.showToast('手机号绑定成功');
@ -63,6 +67,8 @@
}
})
},
//
toAgreement(){
uni.navigateTo({
url:'/pages/login/disclaimers'
@ -71,18 +77,17 @@
//
bindGetUserInfo(e) {
let ya = this;
//
uni.getUserProfile({
desc: '登录',
lang: 'zh_CN',
success: (res) => {
ya.userInfo = res.userInfo;
this.userInfo = res.userInfo;
uni.login({
provider: 'weixin',
success: (res)=> {
if (res.code) {
ya.updateUserInfo(res.code);
this.updateUserInfo(res.code);
} else {
uni.showToast({
title: '登录失败!',
@ -95,9 +100,9 @@
fail: (res) => {}
});
},
//
updateUserInfo(code) {
let ya = this;
uni.showToast({
title: '登录中...',
icon:'loading',
@ -105,17 +110,16 @@
})
var params = {
code:code,
nickname: ya.userInfo.nickName,//
headimgurl: ya.userInfo.avatarUrl,//
country: ya.userInfo.country,//
province: ya.userInfo.province,//
city: ya.userInfo.city,//
gender: ya.userInfo.gender,//
language:ya.userInfo.language,//
invite_code:uni.getStorageSync('inviteCode')?uni.getStorageSync('inviteCode'):'',
nickname: this.userInfo.nickName,//
headimgurl: this.userInfo.avatarUrl,//
country: this.userInfo.country,//
province: this.userInfo.province,//
city: this.userInfo.city,//
gender: this.userInfo.gender,//
language:this.userInfo.language,//
is_active:1
}
this.$requst.post('/api/user/login',params).then(res => {
this.$requst.post('/api/v1/user/login',params).then(res => {
if(res.code == 0){
uni.setStorageSync('userId',res.data.account_id)
uni.setStorageSync('token',res.data.token)//token
@ -123,7 +127,6 @@
uni.setStorageSync('expire',res.data.expire)//
uni.setStorageSync('phone_active',res.data.phone_active)//
uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('invite_code',res.data.invite_code)//
if(uni.getStorageSync('page-path-options')) {
uni.reLaunch({ //
url:uni.getStorageSync('page-path-options')

View File

@ -21,7 +21,7 @@
<view class="title font28">{{item.titele}}</view>
</view>
<view class="more">
<image src="/static/icon/icon-join.png" mode="widthFix" style="width: 14rpx;height: 26rpx;"></image>
<image src="/static/icon-join.png" mode="widthFix" style="width: 14rpx;height: 26rpx;"></image>
</view>
<button class="get-phone-btn" open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber" v-if="index==0&&mobile==''"></button>
</view>
@ -43,6 +43,7 @@
statusHeight:uni.getSystemInfoSync().statusBarHeight, //
headPortrait:'', //
nickName:'', //
mobile:'', //
listData:[
{titele:'个人资料',imgSrc:'/static/icon-my-01.png',iconWidth:36,iconHeight:36},
{titele:'我的发布',imgSrc:'/static/icon-my-02.png',iconWidth:36,iconHeight:36}
@ -60,7 +61,7 @@
uni.showLoading({
title:'加载中'
});
this.$requst.get('/api/user/info').then(res=>{
this.$requst.get('/api/v1/user/info').then(res=>{
console.log(res,'用户信息');
if(res.code==0) {
this.headPortrait = res.data.headimgurl;
@ -101,7 +102,7 @@
iv:e.detail.iv,
encryptedData:e.detail.encryptedData
}
this.$requst.post('/api/user/bind-phone',params).then(res=>{
this.$requst.post('/api/v1/user/bind-phone',params).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('绑定成功');
this.getUserInfo();

View File

@ -9,40 +9,20 @@
<image :src="headImgUrl" mode="widthFix"></image>
</view>
</view>
<view class="item flex">
<view class="item flex" @tap="openEdit('nick_name')">
<view class="title">昵称</view>
<view class="msg">{{nickName}}</view>
</view>
<view class="item flex" @tap="openEdit('real_name')">
<view class="title">真实姓名</view>
<input class="msg" type="text" v-model="realName" disabled="true">
<input class="msg" type="text" v-model="nickName" disabled="true">
<view class="more">
<image src="/static/icon/icon-join.png" mode="widthFix"></image>
<image src="/static/icon-join.png" mode="widthFix"></image>
</view>
</view>
<view class="item flex" style="position: relative;">
<view class="item flex" style="position: relative;" @tap="this.$toolAll.tools.showToast('暂不支持修改手机号');">
<view class="title">联系电话</view>
<input class="msg" type="number" v-model="mobile" disabled="true">
<view class="more">
<image src="/static/icon/icon-join.png" mode="widthFix"></image>
</view>
<button class="get-phone-btn" open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber"></button>
</view>
<picker mode="region" @change="change">
<view class="item flex">
<view class="title">联系地址</view>
<input class="msg" type="text" v-model="area" disabled="true">
<view class="more">
<image src="/static/icon/icon-join.png" mode="widthFix"></image>
</view>
</view>
</picker>
<view class="item flex" @tap="openEdit('address')">
<view class="title">详细地址</view>
<input class="msg" type="text" v-model="address" disabled="true">
<view class="more">
<image src="/static/icon/icon-join.png" mode="widthFix"></image>
<image src="/static/icon-join.png" mode="widthFix"></image>
</view>
<!-- <button class="get-phone-btn" open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber"></button> -->
</view>
</view>
</view>
@ -54,7 +34,7 @@
<view class="pull-list">
<view class="pull-item mar-s20">
<view class="tips color-8c">{{subtitle}}</view>
<input class="input" type="text" v-model="msg" :placeholder="placeholder" placeholder-style="color:#000000">
<input class="input" type="text" v-model="msg" :placeholder="placeholder" placeholder-style="color:#666666">
</view>
</view>
<view class="submit-btn font32 background-blue radius30 color-ff mar-s50 flex" @tap="submitEdit"></view>
@ -75,10 +55,7 @@
headImgUrl:'', //
nickName:'', //
businessCode:'', //
realName:'',//
mobile:'',//
area:'',//
address:'',//
isOpen:false, //
title:'', //
subtitle:'', //
@ -86,9 +63,6 @@
field:'', //
placeholder:'', //
headImg:'', //
province:'', //
city:'', //
county:'', //
isLoading:false,
}
},
@ -104,16 +78,13 @@
uni.showLoading({
title:'加载中'
});
this.$requst.get('/api/user/info').then(res=>{
this.$requst.get('/api/v1/user/info').then(res=>{
console.log(res,'用户信息')
if(res.code==0) {
this.headImgUrl = res.data.headimgurl;
this.nickName = res.data.nickname;
this.businessCode = res.data.business_code;
this.realName= res.data.real_name;
this.mobile= res.data.mobile;
this.area= res.data.province+res.data.city+res.data.county;
this.address= res.data.address;
}
uni.hideLoading();
this.isLoading = true;
@ -122,60 +93,28 @@
//
openEdit(type){
if(type == 'real_name'){
this.title = '真实姓名';
this.subtitle = '真实姓名';
this.placeholder = '请输入真实姓名';
this.msg = this.realName==''?'':this.realName;
if(type == 'nick_name'){
this.title = '昵称';
this.subtitle = '昵称';
this.placeholder = '请输入昵称';
this.msg = this.nickName==''?'':this.nickName;
this.isOpen = true;
this.field = 'real_name';
this.field = 'nick_name';
}
if(type == 'address'){
this.title = '详细地址';
this.subtitle = '详细地址';
this.placeholder = '请输入详细地址';
this.msg = this.address==''?'':this.address;
this.isOpen = true;
this.field = 'address';
}
},
//
change(e){
this.area = e.detail.value[0] + e.detail.value[1] + e.detail.value[2];
this.province = e.detail.value[0];
this.city = e.detail.value[1];
this.county = e.detail.value[2];
this.field = 'area'
setTimeout(()=>{
this.submitEdit()
},200)
},
//
submitEdit(){
if(this.field == 'real_name'){
if(this.field == 'nick_name'){
var params = {
real_name:this.msg
}
console.log(params,123)
}
if(this.field == 'address'){
var params = {
address:this.msg
field:'nickname',
value:this.msg
}
}
if(this.field == 'area'){
var params = {
province:this.province,
city:this.city,
county:this.county
}
}
uni.showLoading({
title:'修改中'
});
if(params){
this.$requst.post('/api/user/edit-info',params).then(res=>{
this.$requst.post('/api/v1/user/update-info',params).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('修改成功');
//
@ -210,7 +149,7 @@
iv:e.detail.iv,
encryptedData:e.detail.encryptedData
}
this.$requst.post('/api/user/bind-phone',params).then(res=>{
this.$requst.post('/api/v1/user/bind-phone',params).then(res=>{
if(res.code==0) {
this.$toolAll.tools.showToast('绑定成功');
//

BIN
static/icon-del.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/icon-join.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@ _vue.default.component('status-nav', statusNav); //全局注册头部组件
// 常用便捷式公共方法
_vue.default.prototype.$toolAll = _tools.default; // 响应数据
_vue.default.prototype.$requst = _requst.default; //公共域名
_vue.default.prototype.$hostHttp = 'https://laonon.scdxtc.cn'; //不显示console.log
_vue.default.prototype.$hostHttp = 'https://idle.scdxtc.cn'; //不显示console.log
if (uni.getSystemInfoSync().platform !== "devtools") {console.log = function () {};}
_App.default.mpType = 'app';
@ -121,7 +121,7 @@ Object.defineProperty(exports, "__esModule", { value: true });exports.default =
projectname: '', // 项目名称
lat: '', // 公司地址维度
lng: '', // 公司地址经度
hostapi: 'https://laonon.scdxtc.cn' // 域名配置
hostapi: 'https://idle.scdxtc.cn' // 域名配置
} };exports.default = _default;
/***/ }),

View File

@ -1172,6 +1172,7 @@ to {
}
}
/* 加载中样式 end */
/* 设置背景颜色 */
/* 设置背景颜色 start */
page{ background-color: #f5f5f5;}
/* 设置背景颜色 end */

View File

@ -762,7 +762,7 @@ function populateParameters(result) {var _result$brand =
var parameters = {
appId: "__UNI__768F35C",
appName: "老农极鲜土货",
appName: "小区闲置",
appVersion: "1.0.0",
appVersionCode: "100",
appLanguage: getAppLanguage(hostLanguage),
@ -871,7 +871,7 @@ var getAppBaseInfo = {
result = sortObject(Object.assign(result, {
appId: "__UNI__768F35C",
appName: "老农极鲜土货",
appName: "小区闲置",
appVersion: "1.0.0",
appVersionCode: "100",
appLanguage: getAppLanguage(hostLanguage),
@ -1464,7 +1464,7 @@ function initData(vueOptions, context) {
try {
data = data.call(context); // 支持 Vue.prototype 上挂的数据
} catch (e) {
if (Object({"VUE_APP_NAME":"老农极鲜土货","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"VUE_APP_NAME":"小区闲置","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
}
}
@ -8556,7 +8556,7 @@ function type(obj) {
function flushCallbacks$1(vm) {
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
if (Object({"VUE_APP_NAME":"老农极鲜土货","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"VUE_APP_NAME":"小区闲置","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
@ -8577,14 +8577,14 @@ function nextTick$1(vm, cb) {
//1.nextTick 之前 已 setData 且 setData 还未回调完成
//2.nextTick 之前存在 render watcher
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
if(Object({"VUE_APP_NAME":"老农极鲜土货","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"VUE_APP_NAME":"小区闲置","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:nextVueTick');
}
return nextTick(cb, vm)
}else{
if(Object({"VUE_APP_NAME":"老农极鲜土货","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"VUE_APP_NAME":"小区闲置","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance$1 = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
']:nextMPTick');
@ -8670,7 +8670,7 @@ var patch = function(oldVnode, vnode) {
});
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
if (Object.keys(diffData).length) {
if (Object({"VUE_APP_NAME":"老农极鲜土货","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"VUE_APP_NAME":"小区闲置","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
']差量更新',
JSON.stringify(diffData));
@ -11006,7 +11006,7 @@ Object.defineProperty(exports, "__esModule", { value: true });exports.default =
}).
replace('<section', '<div').
replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, p1) {
return "<img mode=\"widthFix\" style=\"max-width:100%!important;height:auto\" src='".concat(p1.indexOf('http') > -1 ? p1 : 'https://laonon.scdxtc.cn' + p1, "' />");
return "<img mode=\"widthFix\" style=\"max-width:100%!important;height:auto\" src='".concat(p1.indexOf('http') > -1 ? p1 : 'https://idle.scdxtc.cn' + p1, "' />");
});
},
/**
@ -11371,6 +11371,7 @@ var goLogin = function goLogin() {
};
var flag = true;
// 刷新token并跳转到当前页面
var authTimer = null;
var refreshTokenPage = function refreshTokenPage() {
@ -11389,10 +11390,9 @@ var refreshTokenPage = function refreshTokenPage() {
uni.login({
success: function success(res) {
uni.request({
url: 'https://laonon.scdxtc.cn/api/user/login',
url: "".concat(getApp().globalData.hostapi, "/api/v1/user/login"),
data: {
code: res.code,
invite_code: uni.getStorageSync('inviteCode') ? uni.getStorageSync('inviteCode') : '' },
code: res.code },
success: function success(result) {
if (result.data.code == 0) {
@ -11402,7 +11402,6 @@ var refreshTokenPage = function refreshTokenPage() {
uni.setStorageSync('expire', result.data.data.expire); //缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active', result.data.data.phone_active); //是否授权手机号
uni.setStorageSync('is_active', result.data.data.is_active); //是否授权头像和昵称
uni.setStorageSync('invite_code', result.data.data.invite_code); //缓存邀请码
// 重新进入当前页面
uni.reLaunch({
url: localRoute });
@ -11415,6 +11414,7 @@ var refreshTokenPage = function refreshTokenPage() {
}
flag = true;
};
// 请求错误处理
var checkError = function checkError(e) {
console.log('500接口错误');
@ -11518,6 +11518,7 @@ var request = function request(method, url, options) {
});
};
// 上传文件 封装请求
var uploadFile = function uploadFile(url, options) {
var tempData = options || {};
@ -11544,7 +11545,6 @@ var uploadFile = function uploadFile(url, options) {
});
};var _default =
{
get: function get(url, options) {
return request('get', url, options);

View File

@ -155,9 +155,15 @@ var _default =
methods: {
// 跳转详情
goDetail: function goDetail(id) {
uni.navigateTo({
url: "/pages/goods/detail?id=".concat(id) });
if (this.isOperate) {
uni.navigateTo({
url: "/pages/goods/detail?id=".concat(id, "&type=release") });
} else {
uni.navigateTo({
url: "/pages/goods/detail?id=".concat(id) });
}
},
// 更改显示状态

View File

@ -13,7 +13,7 @@
}
.goods-list .cover.data-v-108270a4{
width: 100%;
height: 350rpx;
height: 320rpx;
overflow: hidden;
margin-bottom: 10rpx;
position: relative;

View File

@ -53,6 +53,7 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
var _default =
{
name: 'status-nav',
@ -105,7 +106,12 @@ var _default =
// 底部距离内容多高
marginBottom: {
type: String,
default: '0' } },
default: '0' },
// 是否可选择小区
estate: {
type: Number,
default: 0 } },
data: function data() {
@ -154,6 +160,12 @@ var _default =
} });
},
// 小区选择
choiceEstate: function choiceEstate(estate) {
uni.navigateTo({
url: "/pages/estate/estate?estate=".concat(estate) });
} } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

View File

@ -1 +1 @@
<view class="status-box data-v-374f26c4" style="{{'margin-bottom:'+(marginBottom)+';'}}"><view style="{{'height:'+(statusBarHeight+'px')+';'+('background:'+(backgroudColor)+';')}}" class="data-v-374f26c4"></view><view class="status-nav flex data-v-374f26c4" style="{{'background:'+(backgroudColor)+';'+('height:'+(navBarHeight)+';')}}"><block wx:if="{{ifReturn}}"><view data-event-opts="{{[['tap',[['backEv',['$event']]]]]}}" class="left-box flex data-v-374f26c4" style="{{'height:'+(navBarHeight)+';'}}" bindtap="__e"><block wx:if="{{$slots.leftcontent}}"><slot name="leftcontent"></slot></block><block wx:else><view class="icon icon-return _i data-v-374f26c4" style="{{'font-size:38rpx;'+('color:'+(returnColor)+';')}}"></view></block></view></block><view class="tab-title data-v-374f26c4" style="{{'color:'+(titleColor)+';'+('justify-content:'+(ifCenter?'center':'')+';')+('padding:'+(ifCenter?'0px':(ifReturn?'0 38':'0 15')+'px')+';')}}"><view class="{{['title-box','data-v-374f26c4',['','clips1','clips2'][clipNumber*1]]}}" style="{{'max-width:'+(ifCenter?'360rpx':'70%')+';'}}"><block wx:if="{{ifTitle&&ifNet}}"><view class="data-v-374f26c4">{{navBarTitle}}</view></block><block wx:if="{{!ifNet}}"><view class="data-v-374f26c4">{{netText}}<text data-event-opts="{{[['tap',[['refreshEv',['$event']]]]]}}" style="color:#3875F6;margin-left:20rpx;" bindtap="__e" class="data-v-374f26c4">刷新</text></view></block></view></view><view class="right-box flex data-v-374f26c4" style="{{'height:'+(navBarHeight)+';'}}"><slot name="rightcontent"></slot></view></view></view>
<view class="status-box data-v-374f26c4" style="{{'margin-bottom:'+(marginBottom)+';'}}"><view style="{{'height:'+(statusBarHeight+'px')+';'+('background:'+(backgroudColor)+';')}}" class="data-v-374f26c4"></view><view class="status-nav flex data-v-374f26c4" style="{{'background:'+(backgroudColor)+';'+('height:'+(navBarHeight)+';')}}"><block wx:if="{{ifReturn}}"><view data-event-opts="{{[['tap',[['backEv',['$event']]]]]}}" class="left-box flex data-v-374f26c4" style="{{'height:'+(navBarHeight)+';'}}" bindtap="__e"><block wx:if="{{$slots.leftcontent}}"><slot name="leftcontent"></slot></block><block wx:else><view class="icon icon-return _i data-v-374f26c4" style="{{'font-size:38rpx;'+('color:'+(returnColor)+';')}}"></view></block></view></block><view class="tab-title data-v-374f26c4" style="{{'color:'+(titleColor)+';'+('justify-content:'+(ifCenter?'center':'')+';')+('padding:'+(ifCenter?'0px':(ifReturn?'0 38':'0 15')+'px')+';')}}"><view class="{{['title-box','data-v-374f26c4',['','clips1','clips2'][clipNumber*1]]}}" style="{{'max-width:'+(ifCenter?'360rpx':'70%')+';'}}"><block wx:if="{{estate!==0&&ifTitle&&ifNet}}"><view data-event-opts="{{[['tap',[['choiceEstate',['$0'],['estate']]]]]}}" bindtap="__e" class="data-v-374f26c4">{{navBarTitle}}</view></block><block wx:if="{{estate==0&&ifTitle&&ifNet}}"><view class="data-v-374f26c4">{{navBarTitle}}</view></block><block wx:if="{{!ifNet}}"><view class="data-v-374f26c4">{{netText}}<text data-event-opts="{{[['tap',[['refreshEv',['$event']]]]]}}" style="color:#3875F6;margin-left:20rpx;" bindtap="__e" class="data-v-374f26c4">刷新</text></view></block></view></view><view class="right-box flex data-v-374f26c4" style="{{'height:'+(navBarHeight)+';'}}"><slot name="rightcontent"></slot></view></view></view>

View File

@ -143,34 +143,14 @@ var _vuex = __webpack_require__(/*! vuex */ 13); //
//
//引入mapState
var _default = { name: 'tabbar', props: { // 当前选中项
current: { type: Number, default: 0 } }, data: function data() {return { footBarList: [] //底部列表
};}, mounted: function mounted() {// 获取当前页面路径
current: { type: Number, default: 0 } }, data: function data() {return { footBarList: [{ iconPath: '/static/icon-idle.png', title: '闲置' }, { iconPath: '/static/icon-my.png', title: '我的' }] //底部列表
};
},
mounted: function mounted() {
// 获取当前页面路径
this.$toolAll.tools.obtainPagePath();
// 获取底部信息
this.getTabbarList();
},
methods: {
// 获取底部信息
getTabbarList: function getTabbarList() {
this.footBarList = [
{ iconPath: '/static/icon-idle.png', title: '闲置' },
{ iconPath: '/static/icon-my.png', title: '我的' }];
// this.$requst.get('/api/index/mini-program-setting').then(res=>{
// if(res.code == 0){
// console.log(res,'底部信息')
// let tabbarArr = [];
// res.data.footBar.forEach(item=>{
// let obj = {
// iconPath:this.$hostHttp+item.icon,
// title:item.name,
// }
// tabbarArr.push(obj)
// })
// this.footBarList = tabbarArr;
// }
// })
},
// 跳转tabbar
chooseFootTab: function chooseFootTab(index) {
switch (index) {
@ -191,9 +171,11 @@ var _default = { name: 'tabbar', props: { // 当前选中项
// 发布商品
goRelease: function goRelease() {
uni.navigateTo({
url: '/pages/idle/release' });
if (this.$toolAll.tools.judgeAuth()) {
uni.navigateTo({
url: '/pages/idle/release' });
}
} } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

View File

@ -181,15 +181,18 @@ __webpack_require__.r(__webpack_exports__);
return {
statusHeight: uni.getSystemInfoSync().statusBarHeight, //状态栏高度
estateList: [], //商品列表
keyword: '', //关键词
page: 1, //页数
size: 10, //条数
total: 0, //总数
isLoading: false //是否加载完成
isLoading: false, //是否加载完成
estate: 0 //0:闲置进入,1:车位进入,2:房屋进入
};
},
onLoad: function onLoad() {
// 获取定位
this.getLocation();
onLoad: function onLoad(op) {
if (op.estate) this.estate = op.estate;
// 查询小区列表
this.getEstateList();
},
onReachBottom: function onReachBottom(e) {
if (this.estateList.length < this.total) {
@ -200,14 +203,12 @@ __webpack_require__.r(__webpack_exports__);
},
methods: {
// 获取定位
getLocation: function getLocation() {var _this = this;
getLocation: function getLocation() {
uni.getLocation({
type: 'wgs84',
geocode: true, // 设置该参数为true可直接获取经纬度及城市信息
success: function success(res) {
console.log('位置信息', res);
// 查询小区列表
_this.getEstateList();
},
fail: function fail(err) {
uni.showToast({
@ -217,55 +218,54 @@ __webpack_require__.r(__webpack_exports__);
} });
},
// 查询商品列表
getEstateList: function getEstateList() {
this.estateList = [
{ id: 1, name: '奥园广场一期', state: 0 },
{ id: 2, name: '奥园广场二期', state: 0 },
{ id: 3, name: '奥园广场三期', state: 0 },
{ id: 4, name: '万圣家园A区', state: 0 },
{ id: 5, name: '万圣家园B区', state: 0 },
{ id: 6, name: '万圣家园C区', state: 0 }];
this.isLoading = true;
// uni.showLoading({
// title:'加载中'
// })
// let params = {
// page:this.page,
// size:this.size,
// addr_id:id
// }
// this.$requst.get('/api/spu/list',params).then(res=>{
// if(res.code == 0){
// console.log(res,'商品列表')
// this.total = res.data.total;
// let goodsArr = [];
// res.data.list.forEach(item=>{
// let obj = {
// id:item.id,
// cover:item.cover,
// name:item.name,
// price:item.price
// }
// goodsArr.push(obj)
// })
// this.goodsList = this.goodsList.concat(goodsArr);
// }
// uni.hideLoading();
// this.isLoading = true;
// })
// 查询小区列表
getEstateList: function getEstateList() {var _this = this;
uni.showLoading({
title: '加载中' });
var params = {
page: this.page,
size: this.size };
if (this.page == 1) this.estateList = [];
this.$requst.get('/api/v1/goods/area', params).then(function (res) {
if (res.code == 0) {
console.log(res, '小区列表');
_this.total = res.data.total;
var estateArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
name: item.title };
estateArr.push(obj);
});
_this.estateList = _this.estateList.concat(estateArr);
}
uni.hideLoading();
_this.isLoading = true;
});
},
// 选择小区
choiseEstate: function choiseEstate(id) {
uni.reLaunch({
url: "/pages/idle/idle" });
choiseEstate: function choiseEstate(id, name) {
// 缓存小区信息
uni.setStorageSync('area_id', id);
uni.setStorageSync('area_name', name);
if (this.estate == 1) {
uni.reLaunch({
url: "/pages/idle/idle" });
}
},
// 返回闲置
backIdle: function backIdle() {
if (!uni.getStorageSync('area_id') || !uni.getStorageSync('area_name')) {
uni.setStorageSync('area_id', this.estateList[0].id);
uni.setStorageSync('area_name', this.estateList[0].name);
}
uni.reLaunch({
url: "/pages/idle/idle" });

View File

@ -1 +1 @@
<block wx:if="{{isLoading}}"><view class="data-v-986dbf74"><status-nav vue-id="75492d00-1" ifReturn="{{false}}" navBarTitle="小区选择" class="data-v-986dbf74" bind:__l="__l"></status-nav><view class="estate-list background-white pad-zy20 border-box data-v-986dbf74"><block wx:for="{{estateList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['choiseEstate',['$event']]]]]}}" class="item font26 flex data-v-986dbf74" bindtap="__e">{{item.name}}</view></block></view><view data-event-opts="{{[['tap',[['backIdle',['$event']]]]]}}" class="back-idle flex data-v-986dbf74" style="{{'top:'+(statusHeight+'px')+';'}}" bindtap="__e"><image src="/static/icon-home.png" mode="widthFix" class="data-v-986dbf74"></image></view></view></block>
<block wx:if="{{isLoading}}"><view class="data-v-986dbf74"><status-nav vue-id="75492d00-1" ifReturn="{{false}}" navBarTitle="小区选择" class="data-v-986dbf74" bind:__l="__l"></status-nav><view class="estate-list background-white pad-zy20 border-box data-v-986dbf74"><block wx:for="{{estateList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['choiseEstate',['$0','$1'],[[['estateList','',index,'id']],[['estateList','',index,'name']]]]]]]}}" class="item font26 flex data-v-986dbf74" bindtap="__e">{{item.name}}</view></block></view><view data-event-opts="{{[['tap',[['backIdle',['$event']]]]]}}" class="back-idle flex data-v-986dbf74" style="{{'top:'+(statusHeight+'px')+';'}}" bindtap="__e"><image src="/static/icon-home.png" mode="widthFix" class="data-v-986dbf74"></image></view></view></block>

View File

@ -218,12 +218,21 @@ var _default =
goodsDetail: {}, //商品详情
goodsImg: [], //商品图片
showPhone: false, //显示电话号码
isLoading: false //是否记载完成
isLoading: false, //是否加载完成
type: '' //是否自己发布
};
},
onShow: function onShow() {
// 查询商品列表
this.getGoodsDetail();
onLoad: function onLoad(op) {
if (op.type == 'release') {
this.type = op.type;
}
if (op.id) {
// 查询商品列表
this.getGoodsDetail(op.id);
} else {
this.$toolAll.tools.showToast('参数不合法');
}
},
onShareAppMessage: function onShareAppMessage(res) {
var shareObj = {
@ -246,35 +255,49 @@ var _default =
},
methods: {
// 查询商品详情
getGoodsDetail: function getGoodsDetail() {
this.goodsDetail = {
name: '儿童自行车',
category_id: 3,
category_name: '儿童玩具',
original_price: '120.00',
price: '30.00',
phone: '18683958573',
imgSrc: '/static/index-01.png,/static/index-02.png,/static/index-03.png',
msg: '九成新儿童自行车,现在小孩到了,已经用不到了,有需要的可以联系哟!' };
getGoodsDetail: function getGoodsDetail(id) {var _this = this;
uni.showLoading({
title: '加载中' });
// 获取图片
this.goodsImg = this.goodsDetail.imgSrc.split(',');
this.$requst.get('/api/v1/goods/detail', { id: id }).then(function (res) {
if (res.code == 0) {
console.log(res, '闲置商品详情');
_this.goodsDetail = {
id: res.data.id,
cover: res.data.cover,
name: res.data.title,
category_name: res.data.category_name,
original_price: res.data.original_price,
price: res.data.price,
phone: res.data.phone,
images: res.data.images,
msg: res.data.content };
this.isLoading = true;
// 获取图片
_this.goodsImg = _this.goodsDetail.images;
}
uni.hideLoading();
_this.isLoading = true;
});
},
// 编辑
editEv: function editEv(id) {
uni.navigateTo({
url: "/pages/release/release?id=3" });
url: "/pages/release/release?id=".concat(id) });
},
// 删除
delEv: function delEv() {
uni.navigateTo({
url: "/pages/goods/goods" });
delEv: function delEv(id) {var _this2 = this;
this.$requst.post('/api/v1/goods/del', { id: id }).then(function (res) {
if (res.code == 0) {
_this2.$toolAll.tools.showToast('删除成功');
uni.navigateTo({
url: "/pages/goods/goods" });
}
});
} } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

View File

@ -1 +1 @@
<block wx:if="{{isLoading}}"><view class="pad-x120 data-v-f0a9f5ba"><status-nav vue-id="6db62043-1" ifReturn="{{true}}" navBarTitle="商品详情" class="data-v-f0a9f5ba" bind:__l="__l"></status-nav><view class="notice-tips color-orange font26 border-box pad-all20 flex data-v-f0a9f5ba"><image src="/static/icon-notice.png" mode="widthFix" class="data-v-f0a9f5ba"></image>交易前请务必核实对方的身份及信息!</view><view class="goods-detail data-v-f0a9f5ba"><view class="goods-info background-white pad-zy20 border-box data-v-f0a9f5ba"><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">商品名称</view><view class="msg data-v-f0a9f5ba">{{goodsDetail.name}}</view></view><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">商品分类</view><view class="msg data-v-f0a9f5ba">{{goodsDetail.category_name}}</view></view><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">商品原价</view><view class="msg color-8c data-v-f0a9f5ba" style="text-decoration:line-through;">{{"¥"+goodsDetail.original_price}}</view></view><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">商品售价</view><view class="msg data-v-f0a9f5ba">{{"¥"+goodsDetail.price}}</view></view><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">联系方式</view><block wx:if="{{showPhone}}"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="msg data-v-f0a9f5ba" bindtap="__e">{{goodsDetail.phone}}</view></block><block wx:else><view class="msg data-v-f0a9f5ba"><view data-event-opts="{{[['tap',[['e1',['$event']]]]]}}" class="see-phone color-ff font24 background-blue radius20 flex data-v-f0a9f5ba" bindtap="__e">查看联系方式</view></view></block></view></view><view class="goods-content background-white pad-all20 mar-s20 font28 border-box data-v-f0a9f5ba"><view class="goods-describe color-8c data-v-f0a9f5ba">{{goodsDetail.msg}}</view><view class="goods-img data-v-f0a9f5ba"><block wx:for="{{goodsImg}}" wx:for-item="item" wx:for-index="index" wx:key="index"><image src="{{item}}" mode="widthFix" class="data-v-f0a9f5ba"></image></block></view></view></view><view class="detail-btns background-white border-box flex data-v-f0a9f5ba"><view data-event-opts="{{[['tap',[['delEv',['$0'],['goodsDetail.id']]]]]}}" class="btn background-orange font30 color-ff radius35 flex data-v-f0a9f5ba" bindtap="__e">删除</view><view data-event-opts="{{[['tap',[['editEv',['$0'],['goodsDetail.id']]]]]}}" class="btn background-blue font30 color-ff radius35 flex data-v-f0a9f5ba" bindtap="__e">编辑</view></view></view></block>
<block wx:if="{{isLoading}}"><view class="{{['data-v-f0a9f5ba',type==''?'':'pad-x120']}}"><status-nav vue-id="6db62043-1" ifReturn="{{true}}" navBarTitle="商品详情" class="data-v-f0a9f5ba" bind:__l="__l"></status-nav><view class="notice-tips color-orange font26 border-box pad-all20 flex data-v-f0a9f5ba"><image src="/static/icon-notice.png" mode="widthFix" class="data-v-f0a9f5ba"></image>交易前请务必核实对方的身份及信息!</view><view class="goods-detail data-v-f0a9f5ba"><view class="goods-info background-white pad-zy20 border-box data-v-f0a9f5ba"><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">商品名称</view><view class="msg data-v-f0a9f5ba">{{goodsDetail.name}}</view></view><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">商品分类</view><view class="msg data-v-f0a9f5ba">{{goodsDetail.category_name}}</view></view><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">商品原价</view><view class="msg color-8c data-v-f0a9f5ba" style="text-decoration:line-through;">{{"¥"+goodsDetail.original_price}}</view></view><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">商品售价</view><view class="msg data-v-f0a9f5ba">{{"¥"+goodsDetail.price}}</view></view><view class="item font28 flex data-v-f0a9f5ba"><view class="title color-8c data-v-f0a9f5ba">联系方式</view><block wx:if="{{showPhone}}"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="msg data-v-f0a9f5ba" bindtap="__e">{{goodsDetail.phone}}</view></block><block wx:else><view class="msg data-v-f0a9f5ba"><view data-event-opts="{{[['tap',[['e1',['$event']]]]]}}" class="see-phone color-ff font24 background-blue radius20 flex data-v-f0a9f5ba" bindtap="__e">查看联系方式</view></view></block></view></view><view class="goods-content background-white pad-all20 mar-s20 font28 border-box data-v-f0a9f5ba"><view class="goods-describe color-8c data-v-f0a9f5ba">{{goodsDetail.msg}}</view><view class="goods-img data-v-f0a9f5ba"><block wx:for="{{goodsImg}}" wx:for-item="item" wx:for-index="index" wx:key="index"><image src="{{item}}" mode="widthFix" class="data-v-f0a9f5ba"></image></block></view></view></view><block wx:if="{{type=='release'}}"><view class="detail-btns background-white border-box flex data-v-f0a9f5ba"><view data-event-opts="{{[['tap',[['delEv',['$0'],['goodsDetail.id']]]]]}}" class="btn background-orange font30 color-ff radius35 flex data-v-f0a9f5ba" bindtap="__e">删除</view><view data-event-opts="{{[['tap',[['editEv',['$0'],['goodsDetail.id']]]]]}}" class="btn background-blue font30 color-ff radius35 flex data-v-f0a9f5ba" bindtap="__e">编辑</view></view></block></view></block>

View File

@ -158,7 +158,7 @@ __webpack_require__.r(__webpack_exports__);
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var goodList = function goodList() {__webpack_require__.e(/*! require.ensure | components/goods-list/goods-list */ "components/goods-list/goods-list").then((function () {return resolve(__webpack_require__(/*! @/components/goods-list/goods-list.vue */ 104));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var _default =
/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var goodsList = function goodsList() {__webpack_require__.e(/*! require.ensure | components/goods-list/goods-list */ "components/goods-list/goods-list").then((function () {return resolve(__webpack_require__(/*! @/components/goods-list/goods-list.vue */ 104));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var _default =
@ -172,7 +172,7 @@ __webpack_require__.r(__webpack_exports__);
{
components: {
goodList: goodList },
goodsList: goodsList },
data: function data() {
return {
@ -216,49 +216,35 @@ __webpack_require__.r(__webpack_exports__);
},
methods: {
// 查询商品列表
getGoodsList: function getGoodsList() {
this.goodsList = [
{ id: 0, name: '儿童自行车', cover: '/static/index-01.png', price: '30.00', original_price: '120.00', state: 1 },
{ id: 0, name: '儿童手表', cover: '/static/index-02.png', price: '480.00', original_price: '160.00', state: 1 },
{ id: 0, name: '尿布台', cover: '/static/index-03.png', price: '120.00', original_price: '480.00', state: 0 },
{ id: 0, name: '儿童自行车', cover: '/static/index-01.png', price: '30.00', original_price: '120.00', state: 1 },
{ id: 0, name: '儿童手表', cover: '/static/index-02.png', price: '480.00', original_price: '160.00', state: 1 },
{ id: 0, name: '尿布台', cover: '/static/index-03.png', price: '120.00', original_price: '480.00', state: 0 },
{ id: 0, name: '儿童自行车', cover: '/static/index-01.png', price: '30.00', original_price: '120.00', state: 1 },
{ id: 0, name: '儿童手表', cover: '/static/index-02.png', price: '480.00', original_price: '160.00', state: 1 },
{ id: 0, name: '尿布台', cover: '/static/index-03.png', price: '120.00', original_price: '480.00', state: 0 },
{ id: 0, name: '儿童自行车', cover: '/static/index-01.png', price: '30.00', original_price: '120.00', state: 1 },
{ id: 0, name: '儿童手表', cover: '/static/index-02.png', price: '480.00', original_price: '160.00', state: 1 },
{ id: 0, name: '尿布台', cover: '/static/index-03.png', price: '120.00', original_price: '480.00', state: 1 }];
getGoodsList: function getGoodsList() {var _this = this;
uni.showLoading({
title: '加载中' });
this.isLoading = true;
// uni.showLoading({
// title:'加载中'
// })
// let params = {
// page:this.page,
// size:this.size,
// addr_id:id
// }
// this.$requst.get('/api/spu/list',params).then(res=>{
// if(res.code == 0){
// console.log(res,'商品列表')
// this.total = res.data.total;
// let goodsArr = [];
// res.data.list.forEach(item=>{
// let obj = {
// id:item.id,
// cover:item.cover,
// name:item.name,
// price:item.price
// }
// goodsArr.push(obj)
// })
// this.goodsList = this.goodsList.concat(goodsArr);
// }
// uni.hideLoading();
// this.isLoading = true;
// })
var params = {
page: this.page,
size: this.size };
if (this.page == 1) this.goodsList = [];
this.$requst.get('/api/v1/user/goods', params).then(function (res) {
if (res.code == 0) {
console.log(res, '我的发布列表');
_this.total = res.data.total;
var goodsArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
cover: item.cover,
name: item.title,
original_price: item.original_price,
price: item.price };
goodsArr.push(obj);
});
_this.goodsList = _this.goodsList.concat(goodsArr);
}
uni.hideLoading();
_this.isLoading = true;
});
},
// 更改显示状态

View File

@ -3,7 +3,6 @@
"enablePullDownRefresh": false,
"usingComponents": {
"status-nav": "/components/status-nav/status-nav",
"goods-list": "/components/goods-list/goods-list",
"good-list": "/components/goods-list/goods-list"
"goods-list": "/components/goods-list/goods-list"
}
}

View File

@ -161,7 +161,7 @@ __webpack_require__.r(__webpack_exports__);
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var goodList = function goodList() {__webpack_require__.e(/*! require.ensure | components/goods-list/goods-list */ "components/goods-list/goods-list").then((function () {return resolve(__webpack_require__(/*! @/components/goods-list/goods-list.vue */ 104));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var tabbar = function tabbar() {Promise.all(/*! require.ensure | components/tabbar/tabbar */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/tabbar/tabbar")]).then((function () {return resolve(__webpack_require__(/*! @/components/tabbar/tabbar */ 111));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var _default =
/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var goodsList = function goodsList() {__webpack_require__.e(/*! require.ensure | components/goods-list/goods-list */ "components/goods-list/goods-list").then((function () {return resolve(__webpack_require__(/*! @/components/goods-list/goods-list.vue */ 104));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var tabbar = function tabbar() {Promise.all(/*! require.ensure | components/tabbar/tabbar */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/tabbar/tabbar")]).then((function () {return resolve(__webpack_require__(/*! @/components/tabbar/tabbar */ 111));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var _default =
@ -178,22 +178,33 @@ __webpack_require__.r(__webpack_exports__);
{
components: {
goodList: goodList,
goodsList: goodsList,
tabbar: tabbar },
data: function data() {
return {
statusHeight: uni.getSystemInfoSync().statusBarHeight, //状态栏高度
pageTitle: '', //页面标题
goodsList: [], //商品列表
category_id: 0, //分类id
keyword: '', //关键词
page: 1, //页数
size: 10, //条数
total: 0, //总数
isLoading: false //是否加载完成
isLoading: false, //是否加载完成
area_id: 0 //小区id
};
},
onShow: function onShow() {
// 查询商品列表
this.getGoodsList();
onLoad: function onLoad() {
if (uni.getStorageSync('area_id') && uni.getStorageSync('area_name')) {
this.area_id = uni.getStorageSync('area_id');
this.pageTitle = uni.getStorageSync('area_name') + '-闲置商品';
// 查询商品列表
this.getGoodsList();
} else {
// 查询小区列表
this.getEstateList();
}
},
onShareAppMessage: function onShareAppMessage(res) {
var shareObj = {
@ -222,57 +233,49 @@ __webpack_require__.r(__webpack_exports__);
}
},
methods: {
// 查询商品列表
getGoodsList: function getGoodsList() {
this.goodsList = [
{ id: 0, name: '儿童自行车', cover: '/static/index-01.png', price: '30.00', original_price: '120.00', state: 1 },
{ id: 0, name: '儿童手表', cover: '/static/index-02.png', price: '480.00', original_price: '160.00', state: 1 },
{ id: 0, name: '尿布台', cover: '/static/index-03.png', price: '120.00', original_price: '480.00', state: 1 },
{ id: 0, name: '儿童自行车', cover: '/static/index-01.png', price: '30.00', original_price: '120.00', state: 1 },
{ id: 0, name: '儿童手表', cover: '/static/index-02.png', price: '480.00', original_price: '160.00', state: 1 },
{ id: 0, name: '尿布台', cover: '/static/index-03.png', price: '120.00', original_price: '480.00', state: 1 },
{ id: 0, name: '儿童自行车', cover: '/static/index-01.png', price: '30.00', original_price: '120.00', state: 1 },
{ id: 0, name: '儿童手表', cover: '/static/index-02.png', price: '480.00', original_price: '160.00', state: 1 },
{ id: 0, name: '尿布台', cover: '/static/index-03.png', price: '120.00', original_price: '480.00', state: 1 },
{ id: 0, name: '儿童自行车', cover: '/static/index-01.png', price: '30.00', original_price: '120.00', state: 1 },
{ id: 0, name: '儿童手表', cover: '/static/index-02.png', price: '480.00', original_price: '160.00', state: 1 },
{ id: 0, name: '尿布台', cover: '/static/index-03.png', price: '120.00', original_price: '480.00', state: 1 }];
this.isLoading = true;
// uni.showLoading({
// title:'加载中'
// })
// let params = {
// page:this.page,
// size:this.size,
// addr_id:id
// }
// this.$requst.get('/api/spu/list',params).then(res=>{
// if(res.code == 0){
// console.log(res,'商品列表')
// this.total = res.data.total;
// let goodsArr = [];
// res.data.list.forEach(item=>{
// let obj = {
// id:item.id,
// cover:item.cover,
// name:item.name,
// price:item.price
// }
// goodsArr.push(obj)
// })
// this.goodsList = this.goodsList.concat(goodsArr);
// }
// uni.hideLoading();
// this.isLoading = true;
// })
// 查询小区列表
getEstateList: function getEstateList() {var _this = this;
this.$requst.get('/api/v1/goods/area').then(function (res) {
if (res.code == 0) {
_this.area_id = res.data.list[0].id;
_this.pageTitle = res.data.list[0].title + '-闲置商品';
// 查询商品列表
_this.getGoodsList();
}
});
},
// 去详情页
goDetail: function goDetail(id) {
uni.navigateTo({
url: "/pages/index/detail?id=".concat(id) });
// 查询商品列表
getGoodsList: function getGoodsList() {var _this2 = this;
uni.showLoading({
title: '加载中' });
var params = {
page: this.page,
size: this.size,
area_id: this.area_id };
if (this.page == 1) this.goodsList = [];
this.$requst.get('/api/v1/goods/list', params).then(function (res) {
if (res.code == 0) {
console.log(res, '闲置商品列表');
_this2.total = res.data.total;
var goodsArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
cover: item.cover,
name: item.title,
original_price: item.original_price,
price: item.price };
goodsArr.push(obj);
});
_this2.goodsList = _this2.goodsList.concat(goodsArr);
}
uni.hideLoading();
_this2.isLoading = true;
});
} } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

View File

@ -4,7 +4,6 @@
"usingComponents": {
"status-nav": "/components/status-nav/status-nav",
"goods-list": "/components/goods-list/goods-list",
"tabbar": "/components/tabbar/tabbar",
"good-list": "/components/goods-list/goods-list"
"tabbar": "/components/tabbar/tabbar"
}
}

View File

@ -1 +1 @@
<block wx:if="{{isLoading}}"><view class="pad-x120 data-v-48338cf4"><status-nav vue-id="be3d0f80-1" ifReturn="{{false}}" navBarTitle="奥园三期-闲置商品" ifCenter="{{false}}" class="data-v-48338cf4" bind:__l="__l"></status-nav><goods-list vue-id="be3d0f80-2" goodsList="{{goodsList}}" class="data-v-48338cf4" bind:__l="__l"></goods-list><view class="no-more mar-s20 font24 color-99 data-v-48338cf4">没有更多数据了</view><tabbar vue-id="be3d0f80-3" class="data-v-48338cf4" bind:__l="__l"></tabbar></view></block>
<block wx:if="{{isLoading}}"><view class="pad-x120 data-v-48338cf4"><status-nav vue-id="be3d0f80-1" ifReturn="{{false}}" navBarTitle="{{pageTitle}}" estate="{{1}}" ifCenter="{{false}}" class="data-v-48338cf4" bind:__l="__l"></status-nav><goods-list vue-id="be3d0f80-2" goodsList="{{goodsList}}" class="data-v-48338cf4" bind:__l="__l"></goods-list><block wx:if="{{goodsList.length==total}}"><view class="no-more mar-s20 font24 color-99 data-v-48338cf4">没有更多数据了</view></block><tabbar vue-id="be3d0f80-3" class="data-v-48338cf4" bind:__l="__l"></tabbar></view></block>

View File

@ -122,6 +122,11 @@ var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
if (!_vm._isMounted) {
_vm.e0 = function($event) {
_vm.cover = ""
}
}
}
var recyclableRender = false
var staticRenderFns = []
@ -205,18 +210,44 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var _default =
{
data: function data() {
return {
statusHeight: uni.getSystemInfoSync().statusBarHeight, //状态栏高度
pageTitle: '', //页面名称
estateList: [], //小区列表
estateIndex: 0, //小区选择
cateList: [], //分类列表
cateIndex: 0, //分类选择
goodsDetail: {}, //商品详情
cover: '', //封面图
goodsImg: [], //商品图片
isEdit: false, //是否编辑进入
isLoading: false //是否记载完成
isLoading: false, //是否记载完成
page: 1, //页数
size: 100, //条数
StagingImg: '' //暂存img
};
},
onLoad: function onLoad(op) {
@ -227,8 +258,8 @@ var _default =
} else {
this.pageTitle = '新增商品';
}
},
onShow: function onShow() {
// 查询小区列表
this.getEstateList();
// 查询分类
this.getCateList();
},
@ -252,15 +283,41 @@ var _default =
return shareObj;
},
methods: {
// 查询分类
getCateList: function getCateList() {
this.cateList = [
{ id: 1, name: '图文书籍' },
{ id: 2, name: '母婴用品' },
{ id: 3, name: '儿童玩具' },
{ id: 4, name: '数码设备' },
{ id: 5, name: '家用电器' }];
// 查询小区列表
getEstateList: function getEstateList() {var _this = this;
this.$requst.get('/api/v1/goods/area').then(function (res) {
if (res.code == 0) {
console.log(res, '小区列表');
var estateArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
name: item.title };
estateArr.push(obj);
});
_this.estateList = _this.estateList.concat(estateArr);
}
});
},
// 查询分类
getCateList: function getCateList() {var _this2 = this;
if (this.page == 1) this.goodsList = [];
this.$requst.get('/api/v1/goods/category').then(function (res) {
if (res.code == 0) {
console.log(res, '物品分类列表');
var cateArr = [];
res.data.forEach(function (item) {
var obj = {
id: item.id,
name: item.title };
cateArr.push(obj);
});
_this2.cateList = cateArr;
}
});
if (this.isEdit) {
// 查询商品详情
this.getGoodsDetail();
@ -270,7 +327,7 @@ var _default =
},
// 查询商品详情
getGoodsDetail: function getGoodsDetail() {var _this = this;
getGoodsDetail: function getGoodsDetail() {var _this3 = this;
this.goodsDetail = {
name: '儿童自行车',
category_id: 3,
@ -281,40 +338,82 @@ var _default =
msg: '九成新儿童自行车,现在小孩到了,已经用不到了,有需要的可以联系哟!' };
// 获取图片
this.goodsImg = this.goodsDetail.imgSrc.split(',');
// this.goodsImg = this.goodsDetail.imgSrc.split(',');
// 获取当前分类
this.cateIndex = this.cateList.findIndex(function (item) {return item.id === _this.goodsDetail.category_id;});
this.cateIndex = this.cateList.findIndex(function (item) {return item.id === _this3.goodsDetail.category_id;});
this.isLoading = true;
},
// 新增闲置商品
addGoodsEv: function addGoodsEv() {
var params = {
title: this.goodsDetail.name,
cover: this.cover,
category_id: this.goodsDetail.category_id,
area_id: this.goodsDetail.area_id,
phone: this.goodsDetail.phone,
original_price: this.goodsDetail.original_price,
price: this.goodsDetail.price,
// images:this.goodsImg.toString().replace(','),
content: this.goodsDetail.msg };
this.$requst.post('/api/v1/goods/add', params).then(function (res) {
if (res.code == 0) {
}
});
},
// 选择分类
choiceCate: function choiceCate(e) {
this.cateIndex = e.detail.value;
},
// 选择小区
choiceEstate: function choiceEstate(e) {
this.estateIndex = e.detail.value;
},
// 选择图片
changeImg: function changeImg() {var _this2 = this;
changeImg: function changeImg(type) {var _this4 = this;
if (type == 'cover') this.cover = '';
uni.chooseImage({
count: 1, //默认9
sourceType: ['album', 'camera'], //从相册选择
success: function success(res) {
_this2.headImg = res.tempFilePaths[0];
_this2.uploadImg();
_this4.StagingImg = res.tempFilePaths[0];
// 上传图片
_this4.uploadImg(type);
} });
},
// 上传图片
uploadImg: function uploadImg() {var _this3 = this;
uploadImg: function uploadImg(type) {var _this5 = this;
uni.showLoading({
title: '上传中' });
this.$requst.upload('/api/file/upload/image', { path: this.headImg }).then(function (res) {
this.$requst.upload('/api/v1/file/upload/image', { path: this.StagingImg }).then(function (res) {
if (res.code == 0) {
_this3.headImgUrl = _this3.$hostHttp + res.data.src;
console.log(_this5.$hostHttp + res.data.src, 1111);
if (type == 'cover') {
_this5.cover = _this5.$hostHttp + res.data.src;
}
if (type == 'img') {
var goodsObj = {};
goodsObj = {
imgSrc: _this5.$hostHttp + res.data.src };
_this5.goodsImg.push(goodsObj);
}
}
uni.hideLoading();
});
},
// 删除图片
delImg: function delImg(index) {
this.goodsImg.splice(index, 1);
} } };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))

File diff suppressed because one or more lines are too long

View File

@ -75,20 +75,32 @@ to {
height: 16rpx;
}
.release-form .item>.upload-box.data-v-becb4076{
flex-wrap: wrap;
box-sizing: border-box;
width: calc(100% - 140rpx);
}
.release-form .item .img.data-v-becb4076,
.release-form .item .upload-btn.data-v-becb4076{
width: 140rpx;
height: 140rpx;
margin-right: 10rpx;
position: relative;
width: 132rpx;
height: 132rpx;
margin: 10rpx 10rpx 0 0;
overflow: hidden;
}
.release-form .item .img>image.data-v-becb4076{
.release-form .item>.img.data-v-becb4076:nth-of-type(4n){
margin-right: 0;
}
.release-form .item .img>image.data-v-becb4076:first-child{
width: 100%;
min-height: 100%;
}
.release-form .item .img>.del-btn.data-v-becb4076{
width: 30rpx;
height: 30rpx;
position: absolute;
right: 2rpx;
top: 2rpx;
}
.release-form .item .upload-btn.data-v-becb4076{
justify-content: center;
align-items: center;

View File

@ -170,18 +170,22 @@ var _default =
_this.appletName = res.data.appletName;
});
},
refuse: function refuse() {//暂不绑定事件
// 暂不绑定事件
refuse: function refuse() {
this.isShowP = false;
this.$toolAll.tools.showToast('登录成功', 'success');
uni.reLaunch({ url: '/pages/idle/idle' });
},
getphonenumber: function getphonenumber(e) {var _this2 = this; //授权绑定手机号
// 授权绑定手机号
getphonenumber: function getphonenumber(e) {var _this2 = this;
var ya = this;
wx.login({
success: function success(res) {
_this2.$requst.post('/api/user/login', { code: res.code }).then(function (result) {
_this2.$requst.post('/api/v1/user/login', { code: res.code }).then(function (result) {
if (e.detail.errMsg == "getPhoneNumber:ok") {
_this2.$requst.post('user/bind-phone', { openid: result.data.openid, session_key: result.data.session_key, iv: e.detail.iv, encryptedData: e.detail.encryptedData }).then(function (res) {
_this2.$requst.post('/api/v1/user/bind-phone', { openid: result.data.openid, session_key: result.data.session_key, iv: e.detail.iv, encryptedData: e.detail.encryptedData }).then(function (res) {
console.log('手机号信息:', res);
if (res.code == 0) {
_this2.$toolAll.tools.showToast('手机号绑定成功');
@ -197,6 +201,8 @@ var _default =
} });
},
// 跳转免责
toAgreement: function toAgreement() {
uni.navigateTo({
url: '/pages/login/disclaimers' });
@ -204,19 +210,18 @@ var _default =
},
//调起登录授权
bindGetUserInfo: function bindGetUserInfo(e) {
var ya = this;
bindGetUserInfo: function bindGetUserInfo(e) {var _this3 = this;
//新版登录方式
uni.getUserProfile({
desc: '登录',
lang: 'zh_CN',
success: function success(res) {
ya.userInfo = res.userInfo;
_this3.userInfo = res.userInfo;
uni.login({
provider: 'weixin',
success: function success(res) {
if (res.code) {
ya.updateUserInfo(res.code);
_this3.updateUserInfo(res.code);
} else {
uni.showToast({
title: '登录失败!',
@ -229,9 +234,9 @@ var _default =
fail: function fail(res) {} });
},
//调用登录接口
updateUserInfo: function updateUserInfo(code) {
var ya = this;
uni.showToast({
title: '登录中...',
icon: 'loading',
@ -239,17 +244,16 @@ var _default =
var params = {
code: code,
nickname: ya.userInfo.nickName, //用户昵称
headimgurl: ya.userInfo.avatarUrl, //用户头像
country: ya.userInfo.country, //用户所在国家
province: ya.userInfo.province, //用户所在省份
city: ya.userInfo.city, //用户所在城市
gender: ya.userInfo.gender, //用户性别
language: ya.userInfo.language, //语言
invite_code: uni.getStorageSync('inviteCode') ? uni.getStorageSync('inviteCode') : '',
nickname: this.userInfo.nickName, //用户昵称
headimgurl: this.userInfo.avatarUrl, //用户头像
country: this.userInfo.country, //用户所在国家
province: this.userInfo.province, //用户所在省份
city: this.userInfo.city, //用户所在城市
gender: this.userInfo.gender, //用户性别
language: this.userInfo.language, //语言
is_active: 1 };
this.$requst.post('/api/user/login', params).then(function (res) {
this.$requst.post('/api/v1/user/login', params).then(function (res) {
if (res.code == 0) {
uni.setStorageSync('userId', res.data.account_id);
uni.setStorageSync('token', res.data.token); //缓存token
@ -257,7 +261,6 @@ var _default =
uni.setStorageSync('expire', res.data.expire); //缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active', res.data.phone_active); //是否授权手机号
uni.setStorageSync('is_active', res.data.is_active); //是否授权头像和昵称
uni.setStorageSync('invite_code', res.data.invite_code); //缓存邀请码
if (uni.getStorageSync('page-path-options')) {
uni.reLaunch({ // 重新进入当前页面
url: uni.getStorageSync('page-path-options') });

View File

@ -200,6 +200,7 @@ var _default = {
statusHeight: uni.getSystemInfoSync().statusBarHeight, //状态栏高度
headPortrait: '', //头像
nickName: '', //用户名
mobile: '', //电话号
listData: [
{ titele: '个人资料', imgSrc: '/static/icon-my-01.png', iconWidth: 36, iconHeight: 36 },
{ titele: '我的发布', imgSrc: '/static/icon-my-02.png', iconWidth: 36, iconHeight: 36 }],
@ -217,7 +218,7 @@ var _default = {
uni.showLoading({
title: '加载中' });
this.$requst.get('/api/user/info').then(function (res) {
this.$requst.get('/api/v1/user/info').then(function (res) {
console.log(res, '用户信息');
if (res.code == 0) {
_this.headPortrait = res.data.headimgurl;
@ -258,7 +259,7 @@ var _default = {
iv: e.detail.iv,
encryptedData: e.detail.encryptedData };
this.$requst.post('/api/user/bind-phone', params).then(function (res) {
this.$requst.post('/api/v1/user/bind-phone', params).then(function (res) {
if (res.code == 0) {
_this2.$toolAll.tools.showToast('绑定成功');
_this2.getUserInfo();

View File

@ -1 +1 @@
<block wx:if="{{isLoading}}"><view class="pad-x120 data-v-0be17cc6"><view class="my-herder border-box data-v-0be17cc6" style="{{'padding-top:'+(statusHeight+50+'px')+';'}}"><view class="my-portrait radius100 data-v-0be17cc6"><image src="{{headPortrait}}" mode="widthFix" class="data-v-0be17cc6"></image></view><view class="my-nickname mar-s10 color-ff font36 flex data-v-0be17cc6"><text class="data-v-0be17cc6">{{nickName}}</text></view></view><view class="my-content background-white radius10 border-box data-v-0be17cc6"><block wx:for="{{listData}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['goPage',[index]]]]]}}" class="item flex data-v-0be17cc6" catchtap="__e"><view class="title flex data-v-0be17cc6"><view class="img flex data-v-0be17cc6"><image style="{{'width:'+(item.iconWidth+'rpx')+';'+('height:'+(item.iconHeight+'rpx')+';')}}" src="{{item.imgSrc}}" mode="widthFix" class="data-v-0be17cc6"></image></view><view class="title font28 data-v-0be17cc6">{{item.titele}}</view></view><view class="more data-v-0be17cc6"><image style="width:14rpx;height:26rpx;" src="/static/icon/icon-join.png" mode="widthFix" class="data-v-0be17cc6"></image></view><block wx:if="{{index==0&&mobile==''}}"><button class="get-phone-btn data-v-0be17cc6" open-type="getPhoneNumber" data-event-opts="{{[['getphonenumber',[['onGetPhoneNumber',['$event']]]]]}}" bindgetphonenumber="__e"></button></block></view></block></view><tabbar vue-id="704e9d00-1" current="1" class="data-v-0be17cc6" bind:__l="__l"></tabbar></view></block>
<block wx:if="{{isLoading}}"><view class="pad-x120 data-v-0be17cc6"><view class="my-herder border-box data-v-0be17cc6" style="{{'padding-top:'+(statusHeight+50+'px')+';'}}"><view class="my-portrait radius100 data-v-0be17cc6"><image src="{{headPortrait}}" mode="widthFix" class="data-v-0be17cc6"></image></view><view class="my-nickname mar-s10 color-ff font36 flex data-v-0be17cc6"><text class="data-v-0be17cc6">{{nickName}}</text></view></view><view class="my-content background-white radius10 border-box data-v-0be17cc6"><block wx:for="{{listData}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['goPage',[index]]]]]}}" class="item flex data-v-0be17cc6" catchtap="__e"><view class="title flex data-v-0be17cc6"><view class="img flex data-v-0be17cc6"><image style="{{'width:'+(item.iconWidth+'rpx')+';'+('height:'+(item.iconHeight+'rpx')+';')}}" src="{{item.imgSrc}}" mode="widthFix" class="data-v-0be17cc6"></image></view><view class="title font28 data-v-0be17cc6">{{item.titele}}</view></view><view class="more data-v-0be17cc6"><image style="width:14rpx;height:26rpx;" src="/static/icon-join.png" mode="widthFix" class="data-v-0be17cc6"></image></view><block wx:if="{{index==0&&mobile==''}}"><button class="get-phone-btn data-v-0be17cc6" open-type="getPhoneNumber" data-event-opts="{{[['getphonenumber',[['onGetPhoneNumber',['$event']]]]]}}" bindgetphonenumber="__e"></button></block></view></block></view><tabbar vue-id="704e9d00-1" current="1" class="data-v-0be17cc6" bind:__l="__l"></tabbar></view></block>

View File

@ -122,6 +122,11 @@ var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
if (!_vm._isMounted) {
_vm.e0 = function($event) {
return this.$toolAll.tools.showToast("暂不支持修改手机号")
}
}
}
var recyclableRender = false
var staticRenderFns = []
@ -203,26 +208,6 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var _default =
{
data: function data() {
@ -232,10 +217,7 @@ var _default =
headImgUrl: '', //头像链接
nickName: '', //昵称
businessCode: '', //会员码
realName: '', //真实姓名
mobile: '', //电话
area: '', //联系地址
address: '', //详细地址
isOpen: false, //是否显示
title: '', //标题
subtitle: '', //副标题
@ -243,9 +225,6 @@ var _default =
field: '', //修改位置
placeholder: '', //默认信息
headImg: '', //缓存头像链接
province: '', //省
city: '', //市
county: '', //区
isLoading: false };
},
@ -261,16 +240,13 @@ var _default =
uni.showLoading({
title: '加载中' });
this.$requst.get('/api/user/info').then(function (res) {
this.$requst.get('/api/v1/user/info').then(function (res) {
console.log(res, '用户信息');
if (res.code == 0) {
_this.headImgUrl = res.data.headimgurl;
_this.nickName = res.data.nickname;
_this.businessCode = res.data.business_code;
_this.realName = res.data.real_name;
_this.mobile = res.data.mobile;
_this.area = res.data.province + res.data.city + res.data.county;
_this.address = res.data.address;
}
uni.hideLoading();
_this.isLoading = true;
@ -279,66 +255,34 @@ var _default =
// 选择修改信息
openEdit: function openEdit(type) {
if (type == 'real_name') {
this.title = '真实姓名';
this.subtitle = '真实姓名';
this.placeholder = '请输入真实姓名';
this.msg = this.realName == '' ? '' : this.realName;
if (type == 'nick_name') {
this.title = '昵称';
this.subtitle = '昵称';
this.placeholder = '请输入昵称';
this.msg = this.nickName == '' ? '' : this.nickName;
this.isOpen = true;
this.field = 'real_name';
this.field = 'nick_name';
}
if (type == 'address') {
this.title = '详细地址';
this.subtitle = '详细地址';
this.placeholder = '请输入详细地址';
this.msg = this.address == '' ? '' : this.address;
this.isOpen = true;
this.field = 'address';
}
},
// 选择省市区
change: function change(e) {var _this2 = this;
this.area = e.detail.value[0] + e.detail.value[1] + e.detail.value[2];
this.province = e.detail.value[0];
this.city = e.detail.value[1];
this.county = e.detail.value[2];
this.field = 'area';
setTimeout(function () {
_this2.submitEdit();
}, 200);
},
// 提交修改
submitEdit: function submitEdit() {var _this3 = this;
if (this.field == 'real_name') {
submitEdit: function submitEdit() {var _this2 = this;
if (this.field == 'nick_name') {
var params = {
real_name: this.msg };
console.log(params, 123);
}
if (this.field == 'address') {
var params = {
address: this.msg };
field: 'nickname',
value: this.msg };
}
if (this.field == 'area') {
var params = {
province: this.province,
city: this.city,
county: this.county };
}
uni.showLoading({
title: '修改中' });
if (params) {
this.$requst.post('/api/user/edit-info', params).then(function (res) {
this.$requst.post('/api/v1/user/update-info', params).then(function (res) {
if (res.code == 0) {
_this3.$toolAll.tools.showToast('修改成功');
_this2.$toolAll.tools.showToast('修改成功');
// 关闭弹窗
_this3.closeEdit();
_this2.closeEdit();
// 刷新用户信息
_this3.getUserData();
_this2.getUserData();
}
});
} else {
@ -359,7 +303,7 @@ var _default =
},
// 获取授权信息
onGetPhoneNumber: function onGetPhoneNumber(e) {var _this4 = this;
onGetPhoneNumber: function onGetPhoneNumber(e) {var _this3 = this;
if (e.detail.errMsg == "getPhoneNumber:fail user deny") {//用户决绝授权
this.$toolAll.tools.showToast('您已拒绝授权');
} else {//允许授权
@ -367,13 +311,13 @@ var _default =
iv: e.detail.iv,
encryptedData: e.detail.encryptedData };
this.$requst.post('/api/user/bind-phone', params).then(function (res) {
this.$requst.post('/api/v1/user/bind-phone', params).then(function (res) {
if (res.code == 0) {
_this4.$toolAll.tools.showToast('绑定成功');
_this3.$toolAll.tools.showToast('绑定成功');
// 刷新用户信息
_this4.getUserData();
_this3.getUserData();
} else {
_this4.$toolAll.tools.showToast(res.msg);
_this3.$toolAll.tools.showToast(res.msg);
}
});

View File

@ -1 +1 @@
<block wx:if="{{isLoading}}"><view class="data-v-3982cd60"><status-nav vue-id="125140b4-1" ifReturn="{{true}}" navBarTitle="个人中心" marginBottom="{{0}}" class="data-v-3982cd60" bind:__l="__l"></status-nav><view class="ucenter-bg border-box data-v-3982cd60" style="{{'min-height:'+(windoHeight-statusHeight-50+'px')+';'}}"><view class="ucenter data-v-3982cd60"><view class="item item-first flex data-v-3982cd60"><view class="title data-v-3982cd60">头像</view><view class="img data-v-3982cd60"><image src="{{headImgUrl}}" mode="widthFix" class="data-v-3982cd60"></image></view></view><view class="item flex data-v-3982cd60"><view class="title data-v-3982cd60">昵称</view><view class="msg data-v-3982cd60">{{nickName}}</view></view><view data-event-opts="{{[['tap',[['openEdit',['real_name']]]]]}}" class="item flex data-v-3982cd60" bindtap="__e"><view class="title data-v-3982cd60">真实姓名</view><input class="msg data-v-3982cd60" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','realName','$event',[]]]]]]}}" value="{{realName}}" bindinput="__e"/><view class="more data-v-3982cd60"><image src="/static/icon/icon-join.png" mode="widthFix" class="data-v-3982cd60"></image></view></view><view class="item flex data-v-3982cd60" style="position:relative;"><view class="title data-v-3982cd60">联系电话</view><input class="msg data-v-3982cd60" type="number" disabled="true" data-event-opts="{{[['input',[['__set_model',['','mobile','$event',[]]]]]]}}" value="{{mobile}}" bindinput="__e"/><view class="more data-v-3982cd60"><image src="/static/icon/icon-join.png" mode="widthFix" class="data-v-3982cd60"></image></view><button class="get-phone-btn data-v-3982cd60" open-type="getPhoneNumber" data-event-opts="{{[['getphonenumber',[['onGetPhoneNumber',['$event']]]]]}}" bindgetphonenumber="__e"></button></view><picker mode="region" data-event-opts="{{[['change',[['change',['$event']]]]]}}" bindchange="__e" class="data-v-3982cd60"><view class="item flex data-v-3982cd60"><view class="title data-v-3982cd60">联系地址</view><input class="msg data-v-3982cd60" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','area','$event',[]]]]]]}}" value="{{area}}" bindinput="__e"/><view class="more data-v-3982cd60"><image src="/static/icon/icon-join.png" mode="widthFix" class="data-v-3982cd60"></image></view></view></picker><view data-event-opts="{{[['tap',[['openEdit',['address']]]]]}}" class="item flex data-v-3982cd60" bindtap="__e"><view class="title data-v-3982cd60">详细地址</view><input class="msg data-v-3982cd60" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','address','$event',[]]]]]]}}" value="{{address}}" bindinput="__e"/><view class="more data-v-3982cd60"><image src="/static/icon/icon-join.png" mode="widthFix" class="data-v-3982cd60"></image></view></view></view></view><view data-event-opts="{{[['tap',[['closeEdit',['$event']]]]]}}" hidden="{{!(isOpen)}}" class="pull-bg data-v-3982cd60" style="background-color:rgba(0,0,0,.3);" bindtap="__e"></view><block wx:if="{{isOpen}}"><view class="pull-box-bg border-box data-v-3982cd60"><view class="pull-box radius20 background-white font30 data-v-3982cd60"><view class="title font32 data-v-3982cd60">{{title}}</view><view class="pull-list data-v-3982cd60"><view class="pull-item mar-s20 data-v-3982cd60"><view class="tips color-8c data-v-3982cd60">{{subtitle}}</view><input class="input data-v-3982cd60" type="text" placeholder="{{placeholder}}" placeholder-style="color:#000000" data-event-opts="{{[['input',[['__set_model',['','msg','$event',[]]]]]]}}" value="{{msg}}" bindinput="__e"/></view></view><view data-event-opts="{{[['tap',[['submitEdit',['$event']]]]]}}" class="submit-btn font32 background-blue radius30 color-ff mar-s50 flex data-v-3982cd60" bindtap="__e">提交修改</view><view data-event-opts="{{[['tap',[['closeEdit',['$event']]]]]}}" class="close-btn data-v-3982cd60" bindtap="__e"><image src="/static/close-btn.png" mode="widthFix" class="data-v-3982cd60"></image></view></view></view></block></view></block>
<block wx:if="{{isLoading}}"><view class="data-v-3982cd60"><status-nav vue-id="125140b4-1" ifReturn="{{true}}" navBarTitle="个人中心" marginBottom="{{0}}" class="data-v-3982cd60" bind:__l="__l"></status-nav><view class="ucenter-bg border-box data-v-3982cd60" style="{{'min-height:'+(windoHeight-statusHeight-50+'px')+';'}}"><view class="ucenter data-v-3982cd60"><view class="item item-first flex data-v-3982cd60"><view class="title data-v-3982cd60">头像</view><view class="img data-v-3982cd60"><image src="{{headImgUrl}}" mode="widthFix" class="data-v-3982cd60"></image></view></view><view data-event-opts="{{[['tap',[['openEdit',['nick_name']]]]]}}" class="item flex data-v-3982cd60" bindtap="__e"><view class="title data-v-3982cd60">昵称</view><input class="msg data-v-3982cd60" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','nickName','$event',[]]]]]]}}" value="{{nickName}}" bindinput="__e"/><view class="more data-v-3982cd60"><image src="/static/icon-join.png" mode="widthFix" class="data-v-3982cd60"></image></view></view><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="item flex data-v-3982cd60" style="position:relative;" bindtap="__e"><view class="title data-v-3982cd60">联系电话</view><input class="msg data-v-3982cd60" type="number" disabled="true" data-event-opts="{{[['input',[['__set_model',['','mobile','$event',[]]]]]]}}" value="{{mobile}}" bindinput="__e"/><view class="more data-v-3982cd60"><image src="/static/icon-join.png" mode="widthFix" class="data-v-3982cd60"></image></view></view></view></view><view data-event-opts="{{[['tap',[['closeEdit',['$event']]]]]}}" hidden="{{!(isOpen)}}" class="pull-bg data-v-3982cd60" style="background-color:rgba(0,0,0,.3);" bindtap="__e"></view><block wx:if="{{isOpen}}"><view class="pull-box-bg border-box data-v-3982cd60"><view class="pull-box radius20 background-white font30 data-v-3982cd60"><view class="title font32 data-v-3982cd60">{{title}}</view><view class="pull-list data-v-3982cd60"><view class="pull-item mar-s20 data-v-3982cd60"><view class="tips color-8c data-v-3982cd60">{{subtitle}}</view><input class="input data-v-3982cd60" type="text" placeholder="{{placeholder}}" placeholder-style="color:#666666" data-event-opts="{{[['input',[['__set_model',['','msg','$event',[]]]]]]}}" value="{{msg}}" bindinput="__e"/></view></view><view data-event-opts="{{[['tap',[['submitEdit',['$event']]]]]}}" class="submit-btn font32 background-blue radius30 color-ff mar-s50 flex data-v-3982cd60" bindtap="__e">提交修改</view><view data-event-opts="{{[['tap',[['closeEdit',['$event']]]]]}}" class="close-btn data-v-3982cd60" bindtap="__e"><image src="/static/close-btn.png" mode="widthFix" class="data-v-3982cd60"></image></view></view></view></block></view></block>

View File

@ -19,8 +19,8 @@
},
"compileType": "miniprogram",
"libVersion": "2.26.2",
"appid": "wx19c92fb80708ae46",
"projectname": "老农极鲜土货",
"appid": "wxf6f7c457ee92d2ac",
"projectname": "小区闲置",
"condition": {
"search": {
"current": -1,

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB